{
  "openapi": "3.0.0",
  "info": {
    "title": "Netsipp Public API",
    "description": "Public API for Netsipp. Authenticate every request with an API key sent as a Bearer token (`Authorization: Bearer {api_key}`). Each endpoint additionally requires the API user to hold the relevant permission.",
    "contact": {
      "name": "Netsipp Support",
      "email": "teknikdestek@netgsm.com.tr"
    },
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.netsipp.com",
      "description": "Public API server"
    }
  ],
  "paths": {
    "/v1/accounts": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "List organization accounts",
        "description": "Paginated list of the API key's organization accounts (members), including the organization owner. Filters: name, surname, email, and a generic `search`. Authenticated by API key.",
        "operationId": "listAccounts",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "surname",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "email",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size (default 15, max 100)",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated accounts",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Account"
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/accounts/{id}": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Show an organization account",
        "description": "Returns a single account (member) of the API key's organization, including the organization owner. The returned fields are identical to the list endpoint. Accounts outside the API key's organization return 404 (never 403), so ids cannot be probed for existence. Requires `api_user|account_view`.",
        "operationId": "getAccount",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Obfuscated account id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Account",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/Account"
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/autodialer/lists/{listId}/records": {
      "post": {
        "tags": [
          "Autodialer"
        ],
        "summary": "Add records to an autodialer list",
        "description": "Adds one or more records to an existing autodialer list. The batch is not all-or-nothing: the response reports how many records were accepted and how many were refused, so a partially accepted batch still returns 200. At most 500 records may be sent in one request (the deployment-wide default) because the import is synchronous and an oversized batch can outrun the upstream timeout. Duplicate detection, number normalization and list state are decided by the campaign engine, not here. `state`, `attempt_count` and `last_result` belong to the campaign engine and are rejected with 422 if sent. Requires `api_user|autodialer_record_create`.",
        "operationId": "createAutodialerRecords",
        "parameters": [
          {
            "name": "listId",
            "in": "path",
            "description": "Autodialer list id. Unlike the other endpoints this is NOT an obfuscated hash id: the list lives in the campaign service and its raw numeric id is the only identifier it has. An unknown id, or one belonging to another organization, returns 404.",
            "required": true,
            "schema": {
              "type": "integer",
              "example": 465
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "records"
                ],
                "properties": {
                  "records": {
                    "description": "Records to add; `phone` is the only required field of a record.",
                    "type": "array",
                    "items": {
                      "required": [
                        "phone"
                      ],
                      "properties": {
                        "phone": {
                          "description": "Number to dial",
                          "type": "string",
                          "example": "05321004512",
                          "maxLength": 24
                        },
                        "external_id": {
                          "description": "Your own identifier for this record",
                          "type": "string",
                          "example": "CRM-10432",
                          "nullable": true,
                          "maxLength": 80
                        },
                        "phone_secondary": {
                          "description": "Fallback number",
                          "type": "string",
                          "example": "02121234567",
                          "nullable": true,
                          "maxLength": 24
                        },
                        "display_label": {
                          "description": "Label shown to the agent",
                          "type": "string",
                          "example": "Ahmet Yilmaz",
                          "nullable": true,
                          "maxLength": 120
                        },
                        "timezone": {
                          "description": "Timezone the record is dialed in",
                          "type": "string",
                          "example": "Europe/Istanbul",
                          "nullable": true,
                          "maxLength": 64
                        },
                        "priority": {
                          "description": "Higher value is dialed first",
                          "type": "integer",
                          "example": 8,
                          "nullable": true,
                          "maximum": 10,
                          "minimum": 1
                        },
                        "not_before": {
                          "description": "ISO-8601 instant before which the record is not dialed",
                          "type": "string",
                          "format": "date-time",
                          "example": "2026-09-18T19:00:00",
                          "nullable": true
                        },
                        "payload": {
                          "description": "Free-form data carried with the record",
                          "type": "object",
                          "example": {
                            "segment": "vip",
                            "bakiye": 1250.5
                          },
                          "nullable": true
                        },
                        "sipheader": {
                          "description": "SIP headers attached to the call as a name/value map; a JSON list is rejected with 422",
                          "type": "object",
                          "example": {
                            "X-Musteri-Segment": "vip",
                            "X-Kampanya-Kod": "YZ2026"
                          },
                          "nullable": true
                        }
                      },
                      "type": "object"
                    },
                    "maxItems": 500,
                    "minItems": 1
                  },
                  "on_duplicate": {
                    "description": "What to do when the number is already in the list: `skip` leaves the existing record untouched and counts the new one as rejected, `update` overwrites it with the submitted fields.",
                    "type": "string",
                    "example": "skip",
                    "nullable": true,
                    "enum": [
                      "skip",
                      "update"
                    ]
                  },
                  "e164_enabled": {
                    "description": "E.164 normalization setting. It is stored on the LIST, not on the records, so sending it changes the list for every later import too; omitting it keeps the list's current setting.",
                    "type": "boolean",
                    "example": true,
                    "nullable": true
                  }
                },
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Import result (fully or partially accepted)",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/AutodialerRecordImportResult"
                    },
                    "message": {
                      "type": "string",
                      "example": "Records submitted successfully."
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The autodialer list does not exist, or belongs to another organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation error, batch over the size limit, or the whole batch refused by the campaign engine",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "The campaign service is unreachable, or no PBX tenant is assigned to the organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/breaks": {
      "get": {
        "tags": [
          "Breaks"
        ],
        "summary": "List breaks",
        "description": "Lists the organization's (non-system) breaks. Filters: name, status, search, page, limit. Requires `api_user|break_view`.",
        "operationId": "listBreaks",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size (default 15, max 100)",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated breaks",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Break"
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Breaks"
        ],
        "summary": "Create a break",
        "description": "Requires `api_user|break_create`. Name must be 3-50 alphanumeric chars, unique within the organization, and not a reserved name (ACW, NotReady, Logout, AutoPause).",
        "operationId": "createBreak",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "name",
                  "color",
                  "duration"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "example": "Lunch",
                    "maxLength": 50,
                    "minLength": 3
                  },
                  "description": {
                    "type": "string",
                    "nullable": true,
                    "maxLength": 255
                  },
                  "color": {
                    "description": "7-char hex color",
                    "type": "string",
                    "example": "#FF5733"
                  },
                  "duration": {
                    "description": "Duration in seconds",
                    "type": "integer",
                    "example": 900
                  },
                  "status": {
                    "type": "boolean",
                    "example": true
                  }
                },
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Break"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation error (e.g. name already used or reserved)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/breaks/{id}": {
      "get": {
        "tags": [
          "Breaks"
        ],
        "summary": "Show a break",
        "description": "Returns a single break. Requires `api_user|break_view`.",
        "operationId": "getBreak",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Obfuscated break id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Break",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Break"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Breaks"
        ],
        "summary": "Delete a break",
        "description": "Soft-deletes the break. System breaks cannot be deleted (403). Requires `api_user|break_delete`.",
        "operationId": "deleteBreak",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Obfuscated break id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission or system break",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "tags": [
          "Breaks"
        ],
        "summary": "Update a break",
        "description": "Partial update; at least one field required. System breaks cannot be updated (403). Requires `api_user|break_update`.",
        "operationId": "updateBreak",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Obfuscated break id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 50,
                    "minLength": 3
                  },
                  "description": {
                    "type": "string",
                    "nullable": true
                  },
                  "color": {
                    "type": "string",
                    "example": "#FF5733"
                  },
                  "duration": {
                    "type": "integer",
                    "example": 900
                  },
                  "status": {
                    "type": "boolean"
                  }
                },
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Break"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission or system break",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/call-scripts": {
      "get": {
        "tags": [
          "Call Scripts"
        ],
        "summary": "List call scripts",
        "description": "Lists the organization's call scripts (with their steps). Filters: name, is_active, search, page, limit. Requires `api_user|call_script_view`.",
        "operationId": "listCallScripts",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "is_active",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "Matched against name",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size (default 15, max 100)",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated call scripts",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CallScript"
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Call Scripts"
        ],
        "summary": "Create a call script",
        "description": "Creates a call script with at least one ordered step. Requires `api_user|call_script_create`.",
        "operationId": "createCallScript",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "name",
                  "steps"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "example": "Outbound sales opener",
                    "maxLength": 255
                  },
                  "description": {
                    "type": "string",
                    "nullable": true
                  },
                  "is_active": {
                    "type": "boolean",
                    "example": true
                  },
                  "steps": {
                    "type": "array",
                    "items": {
                      "required": [
                        "label",
                        "text"
                      ],
                      "properties": {
                        "label": {
                          "type": "string",
                          "example": "Greeting",
                          "maxLength": 255
                        },
                        "text": {
                          "type": "string",
                          "example": "Hello, thank you for taking the call..."
                        },
                        "quote": {
                          "type": "string",
                          "nullable": true
                        },
                        "order": {
                          "type": "integer",
                          "nullable": true,
                          "minimum": 0
                        }
                      },
                      "type": "object"
                    },
                    "minItems": 1
                  }
                },
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallScript"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/call-scripts/{id}": {
      "get": {
        "tags": [
          "Call Scripts"
        ],
        "summary": "Show a call script",
        "description": "Returns a call script with its ordered steps. Requires `api_user|call_script_view`.",
        "operationId": "getCallScript",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Obfuscated call script id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Call script",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallScript"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Call Scripts"
        ],
        "summary": "Delete a call script",
        "description": "Soft-deletes the call script. Requires `api_user|call_script_delete`.",
        "operationId": "deleteCallScript",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Obfuscated call script id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "tags": [
          "Call Scripts"
        ],
        "summary": "Update a call script (partial)",
        "description": "Partial update: send only the fields you want to change (at least one is required). When `steps` is provided it REPLACES the whole step set (steps are not merged); omit it to leave steps untouched. Requires `api_user|call_script_update`.",
        "operationId": "updateCallScript",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Obfuscated call script id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "description": {
                    "type": "string",
                    "nullable": true
                  },
                  "is_active": {
                    "type": "boolean"
                  },
                  "steps": {
                    "type": "array",
                    "items": {
                      "required": [
                        "label",
                        "text"
                      ],
                      "properties": {
                        "label": {
                          "type": "string",
                          "maxLength": 255
                        },
                        "text": {
                          "type": "string"
                        },
                        "quote": {
                          "type": "string",
                          "nullable": true
                        },
                        "order": {
                          "type": "integer",
                          "nullable": true,
                          "minimum": 0
                        }
                      },
                      "type": "object"
                    },
                    "minItems": 1
                  }
                },
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallScript"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/contact-groups": {
      "get": {
        "tags": [
          "Contact Groups"
        ],
        "summary": "List contact groups",
        "description": "Lists the organization's contact groups with their contact counts. Filters: name, search (name/description), page, limit. Requires `api_user|contact_view`.",
        "operationId": "listContactGroups",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size (default 15, max 100)",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated contact groups",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ContactGroupDetail"
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Contact Groups"
        ],
        "summary": "Create a contact group",
        "description": "Group names are unique within the organization. Requires `api_user|contact_create`.",
        "operationId": "createContactGroup",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "example": "VIP",
                    "maxLength": 255
                  },
                  "description": {
                    "type": "string",
                    "nullable": true,
                    "maxLength": 1000
                  }
                },
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactGroupDetail"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation error (e.g. name already used)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/contact-groups/{id}": {
      "get": {
        "tags": [
          "Contact Groups"
        ],
        "summary": "Show a contact group",
        "description": "Returns a contact group with its contact count. Requires `api_user|contact_view`.",
        "operationId": "getContactGroup",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Obfuscated contact group id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Contact group",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactGroupDetail"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Contact Groups"
        ],
        "summary": "Delete a contact group",
        "description": "Soft-deletes the group and removes all its memberships; the contacts themselves are kept. Requires `api_user|contact_delete`.",
        "operationId": "deleteContactGroup",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Obfuscated contact group id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "tags": [
          "Contact Groups"
        ],
        "summary": "Update a contact group",
        "description": "Partial update; at least one field required. Requires `api_user|contact_update`.",
        "operationId": "updateContactGroup",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Obfuscated contact group id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "description": {
                    "type": "string",
                    "nullable": true,
                    "maxLength": 1000
                  }
                },
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ContactGroupDetail"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/contact-groups/{id}/contacts": {
      "get": {
        "tags": [
          "Contact Groups"
        ],
        "summary": "List contacts in a group",
        "description": "Lists the group's contacts. Accepts the same filters as the contact list (name, email, phone, is_blacklisted, search, page, limit). Requires `api_user|contact_view`.",
        "operationId": "listContactGroupContacts",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Obfuscated contact group id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "name",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "email",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "phone",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "is_blacklisted",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size (default 15, max 100)",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated contacts",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Contact"
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Contact Groups"
        ],
        "summary": "Add contacts to a group",
        "description": "Adds up to 100 contacts; contacts already in the group are skipped and `attached` counts only the new memberships. An unknown, deleted or foreign contact id fails the whole request with a 422 reported under its index (e.g. `contact_ids.1`). Requires `api_user|contact_update`.",
        "operationId": "attachContactGroupContacts",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Obfuscated contact group id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactGroupContactIds"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Attached",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "properties": {
                        "attached": {
                          "type": "integer",
                          "example": 2
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Contact Groups"
        ],
        "summary": "Remove contacts from a group",
        "description": "Removes up to 100 contacts from the group; `detached` counts the memberships actually removed. The contacts themselves are kept. An unknown, deleted or foreign contact id fails the whole request with a 422 reported under its index. Requires `api_user|contact_update`.",
        "operationId": "detachContactGroupContacts",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Obfuscated contact group id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ContactGroupContactIds"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Detached",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "properties": {
                        "detached": {
                          "type": "integer",
                          "example": 1
                        }
                      },
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/contacts": {
      "get": {
        "tags": [
          "Contacts"
        ],
        "summary": "List contacts",
        "description": "Lists the organization's contacts. Filters: name, email, phone, is_blacklisted, group_id, page, limit. Requires `api_user|contact_view`.",
        "operationId": "listContacts",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "email",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "phone",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "is_blacklisted",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "group_id",
            "in": "query",
            "description": "Obfuscated contact group id; an unknown id returns an empty list",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size (default 15, max 100)",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated contacts",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Contact"
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Contacts"
        ],
        "summary": "Create a contact",
        "description": "Requires `api_user|contact_create`. `form_values` holds custom (dynamic-form) fields. `group_ids` is optional and assigns the contact to the given groups; an unknown, deleted or foreign group id fails with a 422 reported under its index (e.g. `group_ids.1`).",
        "operationId": "createContact",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "example": "Ada Lovelace",
                    "maxLength": 30,
                    "minLength": 3
                  },
                  "email": {
                    "type": "string",
                    "example": "ada@example.com",
                    "nullable": true
                  },
                  "address": {
                    "type": "string",
                    "nullable": true,
                    "maxLength": 300
                  },
                  "phone_numbers": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 20
                    },
                    "example": [
                      "+905321234567"
                    ]
                  },
                  "description": {
                    "type": "string",
                    "nullable": true,
                    "maxLength": 500
                  },
                  "is_blacklisted": {
                    "type": "boolean"
                  },
                  "form_values": {
                    "type": "object"
                  },
                  "group_ids": {
                    "type": "array",
                    "items": {
                      "description": "Obfuscated contact group id",
                      "type": "string"
                    },
                    "example": [
                      "q8Rk2Lm9p"
                    ],
                    "maxItems": 100
                  }
                },
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission or contact limit reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation error (e.g. phone already used)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/contacts/form": {
      "get": {
        "tags": [
          "Contacts"
        ],
        "summary": "Contact filterable surface",
        "description": "The contact's filterable surface: `columns` are the contact's own database columns, `fields` are its dynamic (custom) form fields. On the ticket list these map to `contact[<key>]` and `contact_form[<key>]` respectively. Returns a null `form` and an empty `fields` list when the organization has no contact form. Requires `api_user|contact_view`.",
        "operationId": "getContactForm",
        "responses": {
          "200": {
            "description": "Contact filter surface",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/ContactForm"
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/contacts/{id}": {
      "get": {
        "tags": [
          "Contacts"
        ],
        "summary": "Show a contact",
        "description": "Returns a contact with groups and custom form values. Requires `api_user|contact_view`.",
        "operationId": "getContact",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Obfuscated contact id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Contact",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Contacts"
        ],
        "summary": "Delete a contact",
        "description": "Soft-deletes the contact. Requires `api_user|contact_delete`.",
        "operationId": "deleteContact",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Obfuscated contact id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "tags": [
          "Contacts"
        ],
        "summary": "Update a contact",
        "description": "Partial update; at least one field required. `form_values` is optional — only the submitted custom fields are updated and required fields are NOT enforced on update (they are enforced on create). Omit form_values to leave custom fields untouched. `group_ids` is optional: omit it to leave group memberships untouched, or send the full set to replace them (an empty list removes the contact from all groups). Requires `api_user|contact_update`.",
        "operationId": "updateContact",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Obfuscated contact id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 30
                  },
                  "email": {
                    "type": "string",
                    "nullable": true
                  },
                  "address": {
                    "type": "string",
                    "nullable": true
                  },
                  "phone_numbers": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "description": {
                    "type": "string",
                    "nullable": true
                  },
                  "is_blacklisted": {
                    "type": "boolean"
                  },
                  "form_values": {
                    "type": "object"
                  },
                  "group_ids": {
                    "type": "array",
                    "items": {
                      "description": "Obfuscated contact group id",
                      "type": "string"
                    },
                    "example": [
                      "q8Rk2Lm9p"
                    ],
                    "maxItems": 100
                  }
                },
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/contacts/{id}/blacklist": {
      "patch": {
        "tags": [
          "Contacts"
        ],
        "summary": "Toggle contact blacklist",
        "description": "Sets the is_blacklisted flag only. Requires `api_user|contact_blacklist`.",
        "operationId": "blacklistContact",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Obfuscated contact id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "is_blacklisted"
                ],
                "properties": {
                  "is_blacklisted": {
                    "type": "boolean",
                    "example": true
                  }
                },
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Contact"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/contacts/{id}/tickets": {
      "get": {
        "tags": [
          "Contacts"
        ],
        "summary": "List a contact's tickets",
        "description": "Up to 50 tickets belonging to the contact. Requires `api_user|contact_view_tickets`.",
        "operationId": "listContactTickets",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Obfuscated contact id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tickets"
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/contacts/{id}/activity-logs": {
      "get": {
        "tags": [
          "Contacts"
        ],
        "summary": "Contact activity logs",
        "description": "Audit trail for the contact and its tickets (paginated: page, limit). Requires `api_user|contact_activity_logs`.",
        "operationId": "listContactActivityLogs",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Obfuscated contact id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size (default 20, max 100)",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Activity log entries"
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/crm/{hizmetNumarasi}/originate": {
      "get": {
        "tags": [
          "CRM"
        ],
        "summary": "Originate",
        "description": "Independently dials an internal extension and a customer number and bridges them once both answer. `originate_order` picks which side is dialed first (`if` = extension first, `of` = customer first).\n\nRequires `api_user|crm_access`. Requests can be long-running: netcrm holds the connection until the call is answered or the `ring_timeout` / `wait_response` windows (both in seconds) elapse. The gateway timeout is 120s (`CRM_SERVICE_TIMEOUT`).",
        "operationId": "crmOriginateGet",
        "parameters": [
          {
            "$ref": "#/components/parameters/CrmHizmetNumarasi"
          },
          {
            "$ref": "#/components/parameters/CrmCrmId"
          },
          {
            "$ref": "#/components/parameters/CrmCustomerNum"
          },
          {
            "$ref": "#/components/parameters/CrmInternalNum"
          },
          {
            "$ref": "#/components/parameters/CrmRingTimeout"
          },
          {
            "$ref": "#/components/parameters/CrmWaitResponse"
          },
          {
            "$ref": "#/components/parameters/CrmOriginateOrder"
          },
          {
            "$ref": "#/components/parameters/CrmTrunk"
          },
          {
            "$ref": "#/components/parameters/CrmCallTime"
          },
          {
            "$ref": "#/components/parameters/CrmHideCallerId"
          },
          {
            "$ref": "#/components/parameters/CrmCallerText"
          },
          {
            "$ref": "#/components/parameters/CrmCalledText"
          },
          {
            "$ref": "#/components/parameters/CrmCallerRecord"
          },
          {
            "$ref": "#/components/parameters/CrmCalledRecord"
          }
        ],
        "responses": {
          "200": {
            "description": "CRM service response, returned verbatim",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrmCallResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing `api_user|crm_access`, or the service no does not belong to your organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "CRM service not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "CRM service unreachable / timed out",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "CRM"
        ],
        "summary": "Originate",
        "description": "Independently dials an internal extension and a customer number and bridges them once both answer. `originate_order` picks which side is dialed first (`if` = extension first, `of` = customer first).\n\nRequires `api_user|crm_access`. Requests can be long-running: netcrm holds the connection until the call is answered or the `ring_timeout` / `wait_response` windows (both in seconds) elapse. The gateway timeout is 120s (`CRM_SERVICE_TIMEOUT`).",
        "operationId": "crmOriginatePost",
        "parameters": [
          {
            "$ref": "#/components/parameters/CrmHizmetNumarasi"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrmOriginateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "CRM service response, returned verbatim",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrmCallResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing `api_user|crm_access`, or the service no does not belong to your organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "CRM service not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "CRM service unreachable / timed out",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/crm/{hizmetNumarasi}/linkup": {
      "get": {
        "tags": [
          "CRM"
        ],
        "summary": "Linkup",
        "description": "Bridges two free-form numbers (`caller` and `called`) over a trunk. Unlike `originate`, either side may be an outside number.\n\nRequires `api_user|crm_access`. Requests can be long-running: netcrm holds the connection until the call is answered or the `ring_timeout` / `wait_response` windows (both in seconds) elapse. The gateway timeout is 120s (`CRM_SERVICE_TIMEOUT`).",
        "operationId": "crmLinkupGet",
        "parameters": [
          {
            "$ref": "#/components/parameters/CrmHizmetNumarasi"
          },
          {
            "$ref": "#/components/parameters/CrmCrmId"
          },
          {
            "$ref": "#/components/parameters/CrmCaller"
          },
          {
            "$ref": "#/components/parameters/CrmCalled"
          },
          {
            "$ref": "#/components/parameters/CrmRingTimeout"
          },
          {
            "$ref": "#/components/parameters/CrmWaitResponse"
          },
          {
            "$ref": "#/components/parameters/CrmOriginateOrder"
          },
          {
            "$ref": "#/components/parameters/CrmTrunk"
          },
          {
            "$ref": "#/components/parameters/CrmCallTime"
          },
          {
            "$ref": "#/components/parameters/CrmCallerText"
          },
          {
            "$ref": "#/components/parameters/CrmCalledText"
          },
          {
            "$ref": "#/components/parameters/CrmCallerRecord"
          },
          {
            "$ref": "#/components/parameters/CrmCalledRecord"
          },
          {
            "$ref": "#/components/parameters/CrmWarningFile"
          },
          {
            "$ref": "#/components/parameters/CrmWarningRemainingSecond"
          }
        ],
        "responses": {
          "200": {
            "description": "CRM service response, returned verbatim",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrmCallResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing `api_user|crm_access`, or the service no does not belong to your organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "CRM service not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "CRM service unreachable / timed out",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "CRM"
        ],
        "summary": "Linkup",
        "description": "Bridges two free-form numbers (`caller` and `called`) over a trunk. Unlike `originate`, either side may be an outside number.\n\nRequires `api_user|crm_access`. Requests can be long-running: netcrm holds the connection until the call is answered or the `ring_timeout` / `wait_response` windows (both in seconds) elapse. The gateway timeout is 120s (`CRM_SERVICE_TIMEOUT`).",
        "operationId": "crmLinkupPost",
        "parameters": [
          {
            "$ref": "#/components/parameters/CrmHizmetNumarasi"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrmLinkupRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "CRM service response, returned verbatim",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrmCallResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing `api_user|crm_access`, or the service no does not belong to your organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "CRM service not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "CRM service unreachable / timed out",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/crm/{hizmetNumarasi}/local": {
      "get": {
        "tags": [
          "CRM"
        ],
        "summary": "Local",
        "description": "Dials two internal extensions of the same PBX against each other (no trunk involved).\n\nRequires `api_user|crm_access`. Requests can be long-running: netcrm holds the connection until the call is answered or the `ring_timeout` / `wait_response` windows (both in seconds) elapse. The gateway timeout is 120s (`CRM_SERVICE_TIMEOUT`).",
        "operationId": "crmLocalGet",
        "parameters": [
          {
            "$ref": "#/components/parameters/CrmHizmetNumarasi"
          },
          {
            "$ref": "#/components/parameters/CrmCrmId"
          },
          {
            "$ref": "#/components/parameters/CrmCaller"
          },
          {
            "$ref": "#/components/parameters/CrmCalled"
          },
          {
            "$ref": "#/components/parameters/CrmRingTimeout"
          },
          {
            "$ref": "#/components/parameters/CrmWaitResponse"
          }
        ],
        "responses": {
          "200": {
            "description": "CRM service response, returned verbatim",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrmCallResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing `api_user|crm_access`, or the service no does not belong to your organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "CRM service not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "CRM service unreachable / timed out",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "CRM"
        ],
        "summary": "Local",
        "description": "Dials two internal extensions of the same PBX against each other (no trunk involved).\n\nRequires `api_user|crm_access`. Requests can be long-running: netcrm holds the connection until the call is answered or the `ring_timeout` / `wait_response` windows (both in seconds) elapse. The gateway timeout is 120s (`CRM_SERVICE_TIMEOUT`).",
        "operationId": "crmLocalPost",
        "parameters": [
          {
            "$ref": "#/components/parameters/CrmHizmetNumarasi"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrmLocalRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "CRM service response, returned verbatim",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrmCallResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing `api_user|crm_access`, or the service no does not belong to your organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "CRM service not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "CRM service unreachable / timed out",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/crm/{hizmetNumarasi}/dynamic_redirect": {
      "get": {
        "tags": [
          "CRM"
        ],
        "summary": "Dynamic redirect",
        "description": "Dials `called` and bridges the call into the target named by `redirect_type` + `redirect_menu`. The full target name is derived upstream: `queue` -> `{hizmetNumarasi}-queue-{redirect_menu}`, `announcement` -> `{hizmetNumarasi}-announcement-{redirect_menu}`, `ivr` -> `{redirect_menu}-{hizmetNumarasi}`. If the target or trunk is not defined on the PBX, the response has `code: \"70\"`. If `brandcode` and `filter` are both sent, an IYS (İleti Yönetim Sistemi) permission check runs first; a number without permission returns `code: \"50\"` (IYS RED) and the call is not placed.\n\nRequires `api_user|crm_access`. Requests can be long-running: netcrm holds the connection until the call is answered or the `ring_timeout` / `wait_response` windows (both in seconds) elapse. The gateway timeout is 120s (`CRM_SERVICE_TIMEOUT`).",
        "operationId": "crmDynamicRedirectGet",
        "parameters": [
          {
            "$ref": "#/components/parameters/CrmHizmetNumarasi"
          },
          {
            "$ref": "#/components/parameters/CrmCrmId"
          },
          {
            "$ref": "#/components/parameters/CrmCalled"
          },
          {
            "$ref": "#/components/parameters/CrmRedirectMenu"
          },
          {
            "$ref": "#/components/parameters/CrmRedirectType"
          },
          {
            "$ref": "#/components/parameters/CrmRingTimeout"
          },
          {
            "$ref": "#/components/parameters/CrmWaitResponse"
          },
          {
            "$ref": "#/components/parameters/CrmTrunk"
          },
          {
            "$ref": "#/components/parameters/CrmPrefix"
          },
          {
            "$ref": "#/components/parameters/CrmCallerId"
          },
          {
            "$ref": "#/components/parameters/CrmCallerText"
          },
          {
            "$ref": "#/components/parameters/CrmCalledText"
          },
          {
            "$ref": "#/components/parameters/CrmCallerRecord"
          },
          {
            "$ref": "#/components/parameters/CrmCalledRecord"
          },
          {
            "$ref": "#/components/parameters/CrmBrandCode"
          },
          {
            "$ref": "#/components/parameters/CrmFilter"
          }
        ],
        "responses": {
          "200": {
            "description": "CRM service response, returned verbatim",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrmCallResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing `api_user|crm_access`, or the service no does not belong to your organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "CRM service not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "CRM service unreachable / timed out",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "CRM"
        ],
        "summary": "Dynamic redirect",
        "description": "Dials `called` and bridges the call into the target named by `redirect_type` + `redirect_menu`. The full target name is derived upstream: `queue` -> `{hizmetNumarasi}-queue-{redirect_menu}`, `announcement` -> `{hizmetNumarasi}-announcement-{redirect_menu}`, `ivr` -> `{redirect_menu}-{hizmetNumarasi}`. If the target or trunk is not defined on the PBX, the response has `code: \"70\"`. If `brandcode` and `filter` are both sent, an IYS (İleti Yönetim Sistemi) permission check runs first; a number without permission returns `code: \"50\"` (IYS RED) and the call is not placed.\n\nRequires `api_user|crm_access`. Requests can be long-running: netcrm holds the connection until the call is answered or the `ring_timeout` / `wait_response` windows (both in seconds) elapse. The gateway timeout is 120s (`CRM_SERVICE_TIMEOUT`).",
        "operationId": "crmDynamicRedirectPost",
        "parameters": [
          {
            "$ref": "#/components/parameters/CrmHizmetNumarasi"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrmDynamicRedirectRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "CRM service response, returned verbatim",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrmCallResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing `api_user|crm_access`, or the service no does not belong to your organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "CRM service not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "CRM service unreachable / timed out",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/crm/{hizmetNumarasi}/hangup": {
      "get": {
        "tags": [
          "CRM"
        ],
        "summary": "Hangup",
        "description": "Hangs up the call identified by `unique_id`. netcrm first tries the last channel of the call, then falls back to the first channel if that fails.\n\nRequires `api_user|crm_access`. Requests can be long-running: netcrm holds the connection until the call is answered or the `ring_timeout` / `wait_response` windows (both in seconds) elapse. The gateway timeout is 120s (`CRM_SERVICE_TIMEOUT`).",
        "operationId": "crmHangupGet",
        "parameters": [
          {
            "$ref": "#/components/parameters/CrmHizmetNumarasi"
          },
          {
            "$ref": "#/components/parameters/CrmCrmId"
          },
          {
            "$ref": "#/components/parameters/CrmUniqueId"
          }
        ],
        "responses": {
          "200": {
            "description": "CRM service response, returned verbatim",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrmBaseResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing `api_user|crm_access`, or the service no does not belong to your organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "CRM service not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "CRM service unreachable / timed out",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "CRM"
        ],
        "summary": "Hangup",
        "description": "Hangs up the call identified by `unique_id`. netcrm first tries the last channel of the call, then falls back to the first channel if that fails.\n\nRequires `api_user|crm_access`. Requests can be long-running: netcrm holds the connection until the call is answered or the `ring_timeout` / `wait_response` windows (both in seconds) elapse. The gateway timeout is 120s (`CRM_SERVICE_TIMEOUT`).",
        "operationId": "crmHangupPost",
        "parameters": [
          {
            "$ref": "#/components/parameters/CrmHizmetNumarasi"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrmHangupRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "CRM service response, returned verbatim",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrmBaseResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing `api_user|crm_access`, or the service no does not belong to your organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "CRM service not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "CRM service unreachable / timed out",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/crm/{hizmetNumarasi}/xfer": {
      "get": {
        "tags": [
          "CRM"
        ],
        "summary": "Xfer",
        "description": "Blind-transfers the active call to `exten` without consulting the other party first.\n\nRequires `api_user|crm_access`. Requests can be long-running: netcrm holds the connection until the call is answered or the `ring_timeout` / `wait_response` windows (both in seconds) elapse. The gateway timeout is 120s (`CRM_SERVICE_TIMEOUT`).",
        "operationId": "crmXferGet",
        "parameters": [
          {
            "$ref": "#/components/parameters/CrmHizmetNumarasi"
          },
          {
            "$ref": "#/components/parameters/CrmCrmId"
          },
          {
            "$ref": "#/components/parameters/CrmUniqueId"
          },
          {
            "$ref": "#/components/parameters/CrmExten"
          }
        ],
        "responses": {
          "200": {
            "description": "CRM service response, returned verbatim",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrmBaseResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing `api_user|crm_access`, or the service no does not belong to your organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "CRM service not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "CRM service unreachable / timed out",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "CRM"
        ],
        "summary": "Xfer",
        "description": "Blind-transfers the active call to `exten` without consulting the other party first.\n\nRequires `api_user|crm_access`. Requests can be long-running: netcrm holds the connection until the call is answered or the `ring_timeout` / `wait_response` windows (both in seconds) elapse. The gateway timeout is 120s (`CRM_SERVICE_TIMEOUT`).",
        "operationId": "crmXferPost",
        "parameters": [
          {
            "$ref": "#/components/parameters/CrmHizmetNumarasi"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrmXferRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "CRM service response, returned verbatim",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrmBaseResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing `api_user|crm_access`, or the service no does not belong to your organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "CRM service not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "CRM service unreachable / timed out",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/crm/{hizmetNumarasi}/atxfer": {
      "get": {
        "tags": [
          "CRM"
        ],
        "summary": "Atxfer",
        "description": "Attended-transfers the active call to `exten`, consulting the target extension before completing the transfer.\n\nRequires `api_user|crm_access`. Requests can be long-running: netcrm holds the connection until the call is answered or the `ring_timeout` / `wait_response` windows (both in seconds) elapse. The gateway timeout is 120s (`CRM_SERVICE_TIMEOUT`).",
        "operationId": "crmAtXferGet",
        "parameters": [
          {
            "$ref": "#/components/parameters/CrmHizmetNumarasi"
          },
          {
            "$ref": "#/components/parameters/CrmCrmId"
          },
          {
            "$ref": "#/components/parameters/CrmUniqueId"
          },
          {
            "$ref": "#/components/parameters/CrmExten"
          }
        ],
        "responses": {
          "200": {
            "description": "CRM service response, returned verbatim",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrmBaseResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing `api_user|crm_access`, or the service no does not belong to your organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "CRM service not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "CRM service unreachable / timed out",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "CRM"
        ],
        "summary": "Atxfer",
        "description": "Attended-transfers the active call to `exten`, consulting the target extension before completing the transfer.\n\nRequires `api_user|crm_access`. Requests can be long-running: netcrm holds the connection until the call is answered or the `ring_timeout` / `wait_response` windows (both in seconds) elapse. The gateway timeout is 120s (`CRM_SERVICE_TIMEOUT`).",
        "operationId": "crmAtXferPost",
        "parameters": [
          {
            "$ref": "#/components/parameters/CrmHizmetNumarasi"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrmAtXferRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "CRM service response, returned verbatim",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrmBaseResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing `api_user|crm_access`, or the service no does not belong to your organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "CRM service not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "CRM service unreachable / timed out",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/crm/{hizmetNumarasi}/muteaudio": {
      "get": {
        "tags": [
          "CRM"
        ],
        "summary": "Muteaudio",
        "description": "Mutes or unmutes one audio direction of the given call.\n\nRequires `api_user|crm_access`. Requests can be long-running: netcrm holds the connection until the call is answered or the `ring_timeout` / `wait_response` windows (both in seconds) elapse. The gateway timeout is 120s (`CRM_SERVICE_TIMEOUT`).",
        "operationId": "crmMuteAudioGet",
        "parameters": [
          {
            "$ref": "#/components/parameters/CrmHizmetNumarasi"
          },
          {
            "$ref": "#/components/parameters/CrmCrmId"
          },
          {
            "$ref": "#/components/parameters/CrmUniqueId"
          },
          {
            "$ref": "#/components/parameters/CrmMuteDirection"
          },
          {
            "$ref": "#/components/parameters/CrmMuteState"
          }
        ],
        "responses": {
          "200": {
            "description": "CRM service response, returned verbatim",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrmBaseResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing `api_user|crm_access`, or the service no does not belong to your organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "CRM service not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "CRM service unreachable / timed out",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "CRM"
        ],
        "summary": "Muteaudio",
        "description": "Mutes or unmutes one audio direction of the given call.\n\nRequires `api_user|crm_access`. Requests can be long-running: netcrm holds the connection until the call is answered or the `ring_timeout` / `wait_response` windows (both in seconds) elapse. The gateway timeout is 120s (`CRM_SERVICE_TIMEOUT`).",
        "operationId": "crmMuteAudioPost",
        "parameters": [
          {
            "$ref": "#/components/parameters/CrmHizmetNumarasi"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrmMuteAudioRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "CRM service response, returned verbatim",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrmBaseResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing `api_user|crm_access`, or the service no does not belong to your organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "CRM service not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "CRM service unreachable / timed out",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/crm/{hizmetNumarasi}/playdtmf": {
      "get": {
        "tags": [
          "CRM"
        ],
        "summary": "Playdtmf",
        "description": "Sends `digit` as DTMF tones to the call, one digit at a time. If any digit fails to send, the operation aborts mid-way and returns an error naming that digit.\n\nRequires `api_user|crm_access`. Requests can be long-running: netcrm holds the connection until the call is answered or the `ring_timeout` / `wait_response` windows (both in seconds) elapse. The gateway timeout is 120s (`CRM_SERVICE_TIMEOUT`).",
        "operationId": "crmPlayDtmfGet",
        "parameters": [
          {
            "$ref": "#/components/parameters/CrmHizmetNumarasi"
          },
          {
            "$ref": "#/components/parameters/CrmCrmId"
          },
          {
            "$ref": "#/components/parameters/CrmUniqueId"
          },
          {
            "$ref": "#/components/parameters/CrmDtmfDirection"
          },
          {
            "$ref": "#/components/parameters/CrmDigit"
          }
        ],
        "responses": {
          "200": {
            "description": "CRM service response, returned verbatim",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrmBaseResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing `api_user|crm_access`, or the service no does not belong to your organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "CRM service not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "CRM service unreachable / timed out",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "CRM"
        ],
        "summary": "Playdtmf",
        "description": "Sends `digit` as DTMF tones to the call, one digit at a time. If any digit fails to send, the operation aborts mid-way and returns an error naming that digit.\n\nRequires `api_user|crm_access`. Requests can be long-running: netcrm holds the connection until the call is answered or the `ring_timeout` / `wait_response` windows (both in seconds) elapse. The gateway timeout is 120s (`CRM_SERVICE_TIMEOUT`).",
        "operationId": "crmPlayDtmfPost",
        "parameters": [
          {
            "$ref": "#/components/parameters/CrmHizmetNumarasi"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrmPlayDtmfRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "CRM service response, returned verbatim",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrmBaseResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing `api_user|crm_access`, or the service no does not belong to your organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "CRM service not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "CRM service unreachable / timed out",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/crm/{hizmetNumarasi}/queuestats": {
      "get": {
        "tags": [
          "CRM"
        ],
        "summary": "Queuestats",
        "description": "Returns live status and statistics for the given queues. When `queue` is omitted, every queue on the PBX is listed. Queue names are given in their short form and are resolved upstream as `{hizmetNumarasi}-queue-{queue}`; if one of them does not exist, the response has `code: \"70\"`. If the AMI connection to the PBX cannot be established, `code: \"90\"` is returned. Unlike every other command, the success body has no `status`/`message` fields — on failure a CrmBaseResponse is returned instead.\n\nRequires `api_user|crm_access`. Requests can be long-running: netcrm holds the connection until the call is answered or the `ring_timeout` / `wait_response` windows (both in seconds) elapse. The gateway timeout is 120s (`CRM_SERVICE_TIMEOUT`).",
        "operationId": "crmQueueStatsGet",
        "parameters": [
          {
            "$ref": "#/components/parameters/CrmHizmetNumarasi"
          },
          {
            "$ref": "#/components/parameters/CrmCrmId"
          },
          {
            "$ref": "#/components/parameters/CrmQueueOptional"
          }
        ],
        "responses": {
          "200": {
            "description": "CRM service response, returned verbatim: queue statistics on success, or a CrmBaseResponse on error",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/CrmQueueStatsResponse"
                    },
                    {
                      "$ref": "#/components/schemas/CrmBaseResponse"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "API key missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing `api_user|crm_access`, or the service no does not belong to your organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "CRM service not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "CRM service unreachable / timed out",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "CRM"
        ],
        "summary": "Queuestats",
        "description": "Returns live status and statistics for the given queues. When `queue` is omitted, every queue on the PBX is listed. Queue names are given in their short form and are resolved upstream as `{hizmetNumarasi}-queue-{queue}`; if one of them does not exist, the response has `code: \"70\"`. If the AMI connection to the PBX cannot be established, `code: \"90\"` is returned. Unlike every other command, the success body has no `status`/`message` fields — on failure a CrmBaseResponse is returned instead.\n\nRequires `api_user|crm_access`. Requests can be long-running: netcrm holds the connection until the call is answered or the `ring_timeout` / `wait_response` windows (both in seconds) elapse. The gateway timeout is 120s (`CRM_SERVICE_TIMEOUT`).",
        "operationId": "crmQueueStatsPost",
        "parameters": [
          {
            "$ref": "#/components/parameters/CrmHizmetNumarasi"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrmQueueStatsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "CRM service response, returned verbatim: queue statistics on success, or a CrmBaseResponse on error",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/CrmQueueStatsResponse"
                    },
                    {
                      "$ref": "#/components/schemas/CrmBaseResponse"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "API key missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing `api_user|crm_access`, or the service no does not belong to your organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "CRM service not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "CRM service unreachable / timed out",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/crm/{hizmetNumarasi}/agentlogin": {
      "get": {
        "tags": [
          "CRM"
        ],
        "summary": "Agentlogin",
        "description": "Adds one or more extensions (`exten`) as members of one or more queues (`queue`). Both fields accept a comma-separated list.\n\nRequires `api_user|crm_access`. Requests can be long-running: netcrm holds the connection until the call is answered or the `ring_timeout` / `wait_response` windows (both in seconds) elapse. The gateway timeout is 120s (`CRM_SERVICE_TIMEOUT`).",
        "operationId": "crmAgentLoginGet",
        "parameters": [
          {
            "$ref": "#/components/parameters/CrmHizmetNumarasi"
          },
          {
            "$ref": "#/components/parameters/CrmCrmId"
          },
          {
            "$ref": "#/components/parameters/CrmExtenList"
          },
          {
            "$ref": "#/components/parameters/CrmQueueList"
          },
          {
            "$ref": "#/components/parameters/CrmPenalty"
          },
          {
            "$ref": "#/components/parameters/CrmPaused"
          }
        ],
        "responses": {
          "200": {
            "description": "CRM service response, returned verbatim",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrmBaseResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing `api_user|crm_access`, or the service no does not belong to your organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "CRM service not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "CRM service unreachable / timed out",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "CRM"
        ],
        "summary": "Agentlogin",
        "description": "Adds one or more extensions (`exten`) as members of one or more queues (`queue`). Both fields accept a comma-separated list.\n\nRequires `api_user|crm_access`. Requests can be long-running: netcrm holds the connection until the call is answered or the `ring_timeout` / `wait_response` windows (both in seconds) elapse. The gateway timeout is 120s (`CRM_SERVICE_TIMEOUT`).",
        "operationId": "crmAgentLoginPost",
        "parameters": [
          {
            "$ref": "#/components/parameters/CrmHizmetNumarasi"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrmAgentLoginRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "CRM service response, returned verbatim",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrmBaseResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing `api_user|crm_access`, or the service no does not belong to your organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "CRM service not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "CRM service unreachable / timed out",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/crm/{hizmetNumarasi}/agentlogoff": {
      "get": {
        "tags": [
          "CRM"
        ],
        "summary": "Agentlogoff",
        "description": "Removes one or more extensions (`exten`) as members of one or more queues (`queue`).\n\nRequires `api_user|crm_access`. Requests can be long-running: netcrm holds the connection until the call is answered or the `ring_timeout` / `wait_response` windows (both in seconds) elapse. The gateway timeout is 120s (`CRM_SERVICE_TIMEOUT`).",
        "operationId": "crmAgentLogoffGet",
        "parameters": [
          {
            "$ref": "#/components/parameters/CrmHizmetNumarasi"
          },
          {
            "$ref": "#/components/parameters/CrmCrmId"
          },
          {
            "$ref": "#/components/parameters/CrmExtenList"
          },
          {
            "$ref": "#/components/parameters/CrmQueueList"
          }
        ],
        "responses": {
          "200": {
            "description": "CRM service response, returned verbatim",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrmBaseResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing `api_user|crm_access`, or the service no does not belong to your organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "CRM service not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "CRM service unreachable / timed out",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "CRM"
        ],
        "summary": "Agentlogoff",
        "description": "Removes one or more extensions (`exten`) as members of one or more queues (`queue`).\n\nRequires `api_user|crm_access`. Requests can be long-running: netcrm holds the connection until the call is answered or the `ring_timeout` / `wait_response` windows (both in seconds) elapse. The gateway timeout is 120s (`CRM_SERVICE_TIMEOUT`).",
        "operationId": "crmAgentLogoffPost",
        "parameters": [
          {
            "$ref": "#/components/parameters/CrmHizmetNumarasi"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrmAgentLogoffRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "CRM service response, returned verbatim",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrmBaseResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing `api_user|crm_access`, or the service no does not belong to your organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "CRM service not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "CRM service unreachable / timed out",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/crm/{hizmetNumarasi}/agentpause": {
      "get": {
        "tags": [
          "CRM"
        ],
        "summary": "Agentpause",
        "description": "Pauses or unpauses an agent on one or more queues. `paused` = `1` pauses the agent, `0` unpauses. Turkish characters in `reason` are ASCII-folded upstream.\n\nRequires `api_user|crm_access`. Requests can be long-running: netcrm holds the connection until the call is answered or the `ring_timeout` / `wait_response` windows (both in seconds) elapse. The gateway timeout is 120s (`CRM_SERVICE_TIMEOUT`).",
        "operationId": "crmAgentPauseGet",
        "parameters": [
          {
            "$ref": "#/components/parameters/CrmHizmetNumarasi"
          },
          {
            "$ref": "#/components/parameters/CrmCrmId"
          },
          {
            "$ref": "#/components/parameters/CrmExtenList"
          },
          {
            "$ref": "#/components/parameters/CrmQueueList"
          },
          {
            "$ref": "#/components/parameters/CrmPaused"
          },
          {
            "$ref": "#/components/parameters/CrmReason"
          }
        ],
        "responses": {
          "200": {
            "description": "CRM service response, returned verbatim",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrmBaseResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing `api_user|crm_access`, or the service no does not belong to your organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "CRM service not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "CRM service unreachable / timed out",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "CRM"
        ],
        "summary": "Agentpause",
        "description": "Pauses or unpauses an agent on one or more queues. `paused` = `1` pauses the agent, `0` unpauses. Turkish characters in `reason` are ASCII-folded upstream.\n\nRequires `api_user|crm_access`. Requests can be long-running: netcrm holds the connection until the call is answered or the `ring_timeout` / `wait_response` windows (both in seconds) elapse. The gateway timeout is 120s (`CRM_SERVICE_TIMEOUT`).",
        "operationId": "crmAgentPausePost",
        "parameters": [
          {
            "$ref": "#/components/parameters/CrmHizmetNumarasi"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrmAgentPauseRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "CRM service response, returned verbatim",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrmBaseResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing `api_user|crm_access`, or the service no does not belong to your organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "CRM service not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "CRM service unreachable / timed out",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/crm/{hizmetNumarasi}/conferencelist": {
      "get": {
        "tags": [
          "CRM"
        ],
        "summary": "Conferencelist",
        "description": "Queries whether the named conference room exists/is active over AMI. The participant list itself is not returned in the response, only the query result.\n\nRequires `api_user|crm_access`. Requests can be long-running: netcrm holds the connection until the call is answered or the `ring_timeout` / `wait_response` windows (both in seconds) elapse. The gateway timeout is 120s (`CRM_SERVICE_TIMEOUT`).",
        "operationId": "crmConferenceListGet",
        "parameters": [
          {
            "$ref": "#/components/parameters/CrmHizmetNumarasi"
          },
          {
            "$ref": "#/components/parameters/CrmCrmId"
          },
          {
            "$ref": "#/components/parameters/CrmConferenceName"
          }
        ],
        "responses": {
          "200": {
            "description": "CRM service response, returned verbatim",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrmBaseResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing `api_user|crm_access`, or the service no does not belong to your organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "CRM service not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "CRM service unreachable / timed out",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "CRM"
        ],
        "summary": "Conferencelist",
        "description": "Queries whether the named conference room exists/is active over AMI. The participant list itself is not returned in the response, only the query result.\n\nRequires `api_user|crm_access`. Requests can be long-running: netcrm holds the connection until the call is answered or the `ring_timeout` / `wait_response` windows (both in seconds) elapse. The gateway timeout is 120s (`CRM_SERVICE_TIMEOUT`).",
        "operationId": "crmConferenceListPost",
        "parameters": [
          {
            "$ref": "#/components/parameters/CrmHizmetNumarasi"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CrmConferenceListRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "CRM service response, returned verbatim",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CrmBaseResponse"
                }
              }
            }
          },
          "401": {
            "description": "API key missing or invalid",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing `api_user|crm_access`, or the service no does not belong to your organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "CRM service not configured",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "504": {
            "description": "CRM service unreachable / timed out",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/interactions": {
      "get": {
        "tags": [
          "Interactions"
        ],
        "summary": "List interactions",
        "description": "Lists the organization's interactions (calls, chats, emails, ...), newest first. Filters: interaction_type (single or array), direction, status, contact_id (obfuscated), channel_id (obfuscated), has_tickets, started_at (single date or \"start,end\" range), page, limit. Timeline items are NOT included in the list. Requires `api_user|interaction_view`.",
        "operationId": "listInteractions",
        "parameters": [
          {
            "name": "interaction_type",
            "in": "query",
            "description": "call|chat|email|system|voicemail (repeatable)",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "call",
                "chat",
                "email",
                "system",
                "voicemail"
              ]
            }
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "inbound",
                "outbound"
              ]
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "true = open, false = closed",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "contact_id",
            "in": "query",
            "description": "Obfuscated contact id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channel_id",
            "in": "query",
            "description": "Obfuscated channel id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "has_tickets",
            "in": "query",
            "description": "Only interactions linked to a ticket",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "started_at",
            "in": "query",
            "description": "Date or \"start,end\" range",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size (default 15, max 100)",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated interactions",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Interaction"
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/interactions/{id}": {
      "get": {
        "tags": [
          "Interactions"
        ],
        "summary": "Show an interaction",
        "description": "Returns a single interaction with its contact, channel, participating agents, linked tickets and full timeline items (ordered by occurred_at). Requires `api_user|interaction_view`.",
        "operationId": "getInteraction",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Obfuscated interaction id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Interaction",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Interaction"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/me": {
      "get": {
        "tags": [
          "Auth"
        ],
        "summary": "Return the authenticated API client",
        "description": "Returns the identity associated with the supplied API key. Useful for verifying that a key is valid and active.",
        "operationId": "getMe",
        "responses": {
          "200": {
            "description": "Authenticated API client",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/ApiClient"
                    },
                    "message": {
                      "type": "string",
                      "example": "Success."
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/projects": {
      "get": {
        "tags": [
          "Projects"
        ],
        "summary": "List projects",
        "description": "Lists the projects of the API key's organization. Supports filters: name, key, is_active, and a generic `search` (name/key). Requires the \"View Project\" permission.",
        "operationId": "listProjects",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "description": "Filter by name (partial match)",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "key",
            "in": "query",
            "description": "Filter by key (partial match)",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "is_active",
            "in": "query",
            "description": "Filter by active flag",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "search",
            "in": "query",
            "description": "Search across name and key",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "List of projects",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Project"
                      }
                    },
                    "message": {
                      "type": "string",
                      "example": "Success."
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Projects"
        ],
        "summary": "Create a project",
        "description": "Creates a project (plus its default ticket form and statuses). Requires the \"Create Project\" permission.",
        "operationId": "createProject",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "name",
                  "key",
                  "manager_id"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "example": "Support",
                    "maxLength": 255
                  },
                  "key": {
                    "type": "string",
                    "example": "SUP",
                    "maxLength": 10
                  },
                  "manager_id": {
                    "description": "Obfuscated account id",
                    "type": "string",
                    "example": "q8Rk2Lm9p"
                  },
                  "logo": {
                    "description": "Logo URL",
                    "type": "string",
                    "nullable": true
                  }
                },
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/Project"
                    },
                    "message": {
                      "type": "string",
                      "example": "Project created successfully."
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission or project limit reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/projects/{id}": {
      "get": {
        "tags": [
          "Projects"
        ],
        "summary": "Show a project",
        "description": "Returns a single project with manager, members, statuses and tags. Requires the \"View Project\" permission.",
        "operationId": "getProject",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Obfuscated project id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Project",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/Project"
                    },
                    "message": {
                      "type": "string",
                      "example": "Success."
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Projects"
        ],
        "summary": "Update a project",
        "description": "Updates name, manager and logo (the key is immutable). Requires the \"Update Project\" permission.",
        "operationId": "updateProject",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Obfuscated project id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "name",
                  "manager_id"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "example": "Support",
                    "maxLength": 255
                  },
                  "manager_id": {
                    "description": "Obfuscated account id",
                    "type": "string",
                    "example": "q8Rk2Lm9p"
                  },
                  "logo": {
                    "type": "string",
                    "nullable": true
                  }
                },
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Project"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Projects"
        ],
        "summary": "Delete a project",
        "description": "Soft-deletes the project. Requires the \"Delete Project\" permission.",
        "operationId": "deleteProject",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Obfuscated project id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/projects/{id}/ticket-statistics": {
      "get": {
        "tags": [
          "Projects"
        ],
        "summary": "Project ticket statistics",
        "description": "Returns ticket counts grouped by status, priority and tag. Requires the \"Project Statistics\" permission.",
        "operationId": "getProjectTicketStatistics",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Obfuscated project id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Statistics",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "properties": {
                        "total": {
                          "type": "integer",
                          "example": 42
                        },
                        "by_status": {
                          "type": "object"
                        },
                        "by_priority": {
                          "type": "object"
                        },
                        "by_tag": {
                          "type": "object"
                        }
                      },
                      "type": "object"
                    },
                    "message": {
                      "type": "string",
                      "example": "Success."
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/projects/{id}/members": {
      "put": {
        "tags": [
          "Projects"
        ],
        "summary": "Add project members",
        "description": "Adds users/accounts to the project (without detaching existing members). Requires the \"Project User Management\" permission.",
        "operationId": "addProjectMembers",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Obfuscated project id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "members"
                ],
                "properties": {
                  "members": {
                    "type": "array",
                    "items": {
                      "required": [
                        "id",
                        "type"
                      ],
                      "properties": {
                        "id": {
                          "description": "Obfuscated user/account id",
                          "type": "string",
                          "example": "q8Rk2Lm9p"
                        },
                        "type": {
                          "type": "string",
                          "example": "user",
                          "enum": [
                            "user",
                            "account"
                          ]
                        }
                      },
                      "type": "object"
                    }
                  }
                },
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Project with members",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Project"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation error / member not in organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Projects"
        ],
        "summary": "Remove a project member",
        "description": "Removes a single user/account from the project. The project manager cannot be removed. Requires the \"Project User Management\" permission.",
        "operationId": "removeProjectMember",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Obfuscated project id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "member_id",
                  "member_type"
                ],
                "properties": {
                  "member_id": {
                    "description": "Obfuscated user/account id",
                    "type": "string",
                    "example": "q8Rk2Lm9p"
                  },
                  "member_type": {
                    "type": "string",
                    "example": "user",
                    "enum": [
                      "user",
                      "account"
                    ]
                  }
                },
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Project with members",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Project"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Cannot remove the project manager",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/quick-replies": {
      "get": {
        "tags": [
          "QuickReplies"
        ],
        "summary": "List quick replies",
        "description": "Lists the organization-wide quick replies. Filters: search (title/shortcut/content), channel, is_active, page, limit. Requires `api_user|quick_reply_view`.",
        "operationId": "listQuickReplies",
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "is_active",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size (default 15, max 100)",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated quick replies",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/QuickReply"
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "QuickReplies"
        ],
        "summary": "Create a quick reply",
        "description": "Creates an organization-wide quick reply. Requires `api_user|quick_reply_create`. `shortcut` must be unique within the organization.",
        "operationId": "createQuickReply",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "title",
                  "content"
                ],
                "properties": {
                  "title": {
                    "type": "string",
                    "example": "Karşılama mesajı",
                    "maxLength": 150
                  },
                  "shortcut": {
                    "type": "string",
                    "example": "/merhaba",
                    "nullable": true,
                    "maxLength": 50
                  },
                  "content": {
                    "type": "string",
                    "example": "Merhaba, size nasıl yardımcı olabilirim?"
                  },
                  "channel_keys": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 50
                    },
                    "example": [
                      "email",
                      "sms"
                    ]
                  },
                  "is_active": {
                    "type": "boolean",
                    "example": true
                  }
                },
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuickReply"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation error (e.g. shortcut already used)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/quick-replies/{id}": {
      "get": {
        "tags": [
          "QuickReplies"
        ],
        "summary": "Show a quick reply",
        "description": "Returns a single organization-wide quick reply. Requires `api_user|quick_reply_view`.",
        "operationId": "getQuickReply",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Obfuscated quick-reply id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Quick reply",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuickReply"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "QuickReplies"
        ],
        "summary": "Delete a quick reply",
        "description": "Soft-deletes the quick reply. Requires `api_user|quick_reply_delete`.",
        "operationId": "deleteQuickReply",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Obfuscated quick-reply id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "tags": [
          "QuickReplies"
        ],
        "summary": "Update a quick reply",
        "description": "Partial update; at least one field required. Requires `api_user|quick_reply_update`.",
        "operationId": "updateQuickReply",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Obfuscated quick-reply id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "title": {
                    "type": "string",
                    "maxLength": 150
                  },
                  "shortcut": {
                    "type": "string",
                    "nullable": true,
                    "maxLength": 50
                  },
                  "content": {
                    "type": "string"
                  },
                  "channel_keys": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "maxLength": 50
                    }
                  },
                  "is_active": {
                    "type": "boolean"
                  }
                },
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QuickReply"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/reports/call-details": {
      "get": {
        "tags": [
          "Reports"
        ],
        "summary": "Call detail report",
        "description": "Lists the organization's calls (\"Çağrı Detayları\"), newest call first. Ordering is fixed at call_start_time DESC and cannot be changed: sending `sort` or `order` returns 422 rather than being ignored. When only one of date_from / date_to is given the other defaults to today; omitting both reports today. The date window may not exceed 365 days. Rows come from the reporting backend, so a temporarily unreachable backend returns 503. Requires `api_user|report_call_detail_view`.",
        "operationId": "listCallDetailReport",
        "parameters": [
          {
            "name": "date_from",
            "in": "query",
            "description": "Start date, YYYY-MM-DD (default today)",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "date_to",
            "in": "query",
            "description": "End date, YYYY-MM-DD (default today)",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "call_type",
            "in": "query",
            "description": "Repeatable, or a comma-separated list",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "INBOUND_QUEUE",
                "OUTBOUND",
                "INBOUND_IVR",
                "INBOUND_DIRECT",
                "INBOUND_INTERACTIVE",
                "INBOUND_ANNOUNCEMENT",
                "CRM_QUEUE",
                "CRM_INTERACTIVE",
                "CRM_ANNOUNCEMENT",
                "CRM_IVR",
                "LOCALCALL"
              ]
            }
          },
          {
            "name": "direction",
            "in": "query",
            "description": "in = inbound, out = outbound",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "in",
                "out"
              ]
            }
          },
          {
            "name": "queue",
            "in": "query",
            "description": "Queue name",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agent_rid",
            "in": "query",
            "description": "Answering agent record id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "src",
            "in": "query",
            "description": "Calling number",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "dst",
            "in": "query",
            "description": "Called number",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size (default 15); a larger value is capped at 100",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated call detail rows",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CallDetailReport"
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Invalid filter, unsupported sort parameter, or date range over the limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "The reporting backend is unreachable, or no PBX tenant is assigned to the organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/projects/{projectId}/statuses": {
      "get": {
        "tags": [
          "Tickets"
        ],
        "summary": "List project ticket statuses",
        "description": "Ticket statuses (kanban columns) of a project, ordered. Use a returned status `id` when creating/updating a ticket. Requires `api_user|ticket_status_view`.",
        "operationId": "listProjectStatuses",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Obfuscated project id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Statuses",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/TicketStatus"
                      }
                    },
                    "message": {
                      "type": "string",
                      "example": "Success."
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Project not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/projects/{projectId}/tickets": {
      "get": {
        "tags": [
          "Tickets"
        ],
        "summary": "List project tickets",
        "description": "Paginated tickets of a project. Filters: priority, assigned_to, created_at (single date or \"start,end\"), number (contact phone number; last 10 significant digits matched), `form[<key>]` (the ticket's own dynamic fields), `contact[<column>]` and `contact_form[<key>]` (the linked contact), and a generic `search` (ticket_key). Different keys are AND-ed, values of one key are OR-ed. At most 5 fields per request in total across `form` and `contact_form` (the whole `contact` block counts as one), and at most 50 values per field. Requires `api_user|ticket_view`.",
        "operationId": "listTickets",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Obfuscated project id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "form",
            "in": "query",
            "description": "Filter by the project's dynamic (custom) form fields. Valid keys come from GET /v1/projects/{projectId}/ticket-form. `?form[priority_level]=high` matches exactly (eq); `?form[priority_level][]=high&form[priority_level][]=low` matches any of the values (in). Different keys are ANDed, values of one key are ORed. Max 5 fields per request, max 50 values per field; unknown keys and any other shape return 422.",
            "required": false,
            "style": "deepObject",
            "explode": true,
            "schema": {
              "type": "object",
              "additionalProperties": {
                "oneOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                ]
              }
            }
          },
          {
            "name": "include",
            "in": "query",
            "description": "Comma separated extra data. Allowed: `form_values` (dynamic field values of every listed ticket). Any other value returns 422.",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "form_values"
              ]
            }
          },
          {
            "name": "priority",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "low",
                "medium",
                "high"
              ]
            }
          },
          {
            "name": "assigned_to",
            "in": "query",
            "description": "Obfuscated user id",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "created_at",
            "in": "query",
            "description": "Date or \"start,end\" range",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "number",
            "in": "query",
            "description": "Contact phone number. Non-digits are stripped and the last 10 significant digits are matched, so \"+90 532 123 45 67\", \"05321234567\" and \"5321234567\" are equivalent.",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "contact",
            "in": "query",
            "description": "Filter by the linked contact's own columns: `contact[name]`, `contact[email]`, `contact[phone]`, `contact[address]`, `contact[description]`, `contact[is_blacklisted]`. Text columns match with \"contains\"; `phone` compares the last 10 significant digits. Tickets without a contact never match. Discover the surface via `GET /v1/contacts/form`.",
            "required": false,
            "style": "deepObject",
            "explode": true,
            "schema": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            }
          },
          {
            "name": "contact_form",
            "in": "query",
            "description": "Filter by the linked contact's dynamic form fields, same syntax as `form`. Keys come from `GET /v1/contacts/form`. Tickets without a contact never match.",
            "required": false,
            "style": "deepObject",
            "explode": true,
            "schema": {
              "type": "object",
              "additionalProperties": {
                "type": "string"
              }
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size (default 15, max 100)",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated tickets",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Ticket"
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Project not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Invalid query parameter (unknown form field, malformed filter, unknown include, ...)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Tickets"
        ],
        "summary": "Create a ticket",
        "description": "Creates a ticket in the project (generates ticket_key/number/order). `form_values` custom fields are validated (required enforced). Multi-valued fields (`checkbox`, `select`, `autocomplete`) must be sent as an array even for a single value (`[\"option-1\"]`); a scalar is rejected with 422. Requires `api_user|ticket_create`.",
        "operationId": "createTicket",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Obfuscated project id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "status_id",
                  "priority"
                ],
                "properties": {
                  "status_id": {
                    "description": "Obfuscated status id (must belong to the project)",
                    "type": "string"
                  },
                  "priority": {
                    "type": "string",
                    "enum": [
                      "low",
                      "medium",
                      "high"
                    ]
                  },
                  "assigned_to": {
                    "description": "Obfuscated user id",
                    "type": "string",
                    "nullable": true
                  },
                  "contact_id": {
                    "description": "Obfuscated contact id",
                    "type": "string",
                    "nullable": true
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "color": {
                          "type": "string",
                          "nullable": true
                        }
                      },
                      "type": "object"
                    }
                  },
                  "form_values": {
                    "type": "object"
                  }
                },
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ticket"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Project not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation error (status not in project, required custom field, ...)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/projects/{projectId}/ticket-form": {
      "get": {
        "tags": [
          "Tickets"
        ],
        "summary": "Ticket custom field schema",
        "description": "Dynamic (custom) form fields attached to the project's tickets. `key` values are the ones accepted by the ticket list `form[<key>]` filter. Returns an empty `fields` list when the project has no form. Requires `api_user|ticket_view`.",
        "operationId": "getTicketForm",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Obfuscated project id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ticket form schema",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TicketForm"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Project not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/projects/{projectId}/tickets/{id}": {
      "get": {
        "tags": [
          "Tickets"
        ],
        "summary": "Show a ticket",
        "description": "Returns a ticket with status, assignee, contact, tags and custom form values. Requires `api_user|ticket_view`.",
        "operationId": "getTicket",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Obfuscated project id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Obfuscated ticket id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ticket",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ticket"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Tickets"
        ],
        "summary": "Delete a ticket",
        "description": "Soft-deletes the ticket. Requires `api_user|ticket_delete`.",
        "operationId": "deleteTicket",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Obfuscated project id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Obfuscated ticket id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "patch": {
        "tags": [
          "Tickets"
        ],
        "summary": "Update a ticket (partial)",
        "description": "Partial update: send only the fields you want to change (at least one is required). `assigned_to` sent as null unassigns; `tags` replaces the tag set; `form_values` upserts only the submitted custom fields (no required enforcement). Multi-valued fields (`checkbox`, `select`, `autocomplete`) must be sent as an array even for a single value (`[\"option-1\"]`); a scalar is rejected with 422. Requires `api_user|ticket_update`.",
        "operationId": "updateTicket",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "description": "Obfuscated project id",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "description": "Obfuscated ticket id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "status_id": {
                    "type": "string"
                  },
                  "priority": {
                    "type": "string",
                    "enum": [
                      "low",
                      "medium",
                      "high"
                    ]
                  },
                  "assigned_to": {
                    "type": "string",
                    "nullable": true
                  },
                  "tags": {
                    "type": "array",
                    "items": {
                      "properties": {
                        "name": {
                          "type": "string"
                        },
                        "color": {
                          "type": "string",
                          "nullable": true
                        }
                      },
                      "type": "object"
                    }
                  },
                  "form_values": {
                    "type": "object"
                  }
                },
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Ticket"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/trunks": {
      "get": {
        "tags": [
          "Trunks"
        ],
        "summary": "List trunks",
        "description": "Lists every trunk of the organization's PBX, `fct` and `fctmvno` included, with its `type`. The list is not paginated: the PBX returns it whole. The SIP secret is never returned. Requires `api_user|trunk_view`.",
        "operationId": "listTrunks",
        "responses": {
          "200": {
            "description": "Trunks",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Trunk"
                      }
                    },
                    "message": {
                      "type": "string",
                      "example": "Success."
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "The PBX is unreachable, or no PBX tenant is assigned to the organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "post": {
        "tags": [
          "Trunks"
        ],
        "summary": "Create a trunk with every PBX setting",
        "description": "Creates a trunk with any field the PBX accepts. `type` may only be `netgsm` or `custom` (omitted: `netgsm` for Netgsm hosts, `custom` otherwise); `fct` and `fctmvno` are rejected with 422. `port` defaults to 5060, and `transport` to `transport-udp` when neither `inbound_identification` nor `inbound_pattern` is sent. `name`, `secret` and `host` are required unless `inbound_pattern` is sent; `permit` is required unless the host is the Netgsm SIP server. An `inbound_pattern` without `name` uses its prefix as the name. `tenantid`, `id`, `deny`, `field_policy` and `identification_mode` are rejected with 422. Creating a trunk is capped by the number of phone line packages the organization owns; every existing trunk except `fct` ones counts against it (`fctmvno` counts). No phone line package returns 403 (also when the package check cannot be completed); a full quota returns 422, and a second create running for the same organization returns 429 after waiting up to 5 seconds. A 429 is also returned when the PBX trunk limit for the organization is reached. Requires `api_user|trunk_create`.",
        "operationId": "createTrunk",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "type": {
                    "type": "string",
                    "example": "custom",
                    "nullable": true,
                    "enum": [
                      "netgsm",
                      "custom"
                    ]
                  },
                  "name": {
                    "description": "Letters, digits and `+` only; unique across the whole PBX platform, a taken name returns 409",
                    "type": "string",
                    "pattern": "^[A-Za-z0-9+]+$",
                    "example": "TRUNK1001",
                    "maxLength": 50
                  },
                  "secret": {
                    "type": "string",
                    "example": "s3cr3t!",
                    "maxLength": 255
                  },
                  "host": {
                    "type": "string",
                    "example": "sip.example.com",
                    "maxLength": 255
                  },
                  "port": {
                    "type": "integer",
                    "example": 5060,
                    "maximum": 65535,
                    "minimum": 1
                  },
                  "register": {
                    "type": "boolean",
                    "example": false
                  },
                  "permit": {
                    "description": "Joined as \"ip/subnet;...\" it must fit in 255 characters",
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/TrunkPermitEntry"
                    },
                    "maxItems": 20,
                    "minItems": 1
                  },
                  "context": {
                    "type": "string",
                    "example": "from-outside"
                  },
                  "transport": {
                    "type": "string",
                    "example": "transport-udp"
                  },
                  "callerid": {
                    "type": "string",
                    "nullable": true
                  },
                  "user_eq_phone": {
                    "type": "string",
                    "enum": [
                      "yes",
                      "no"
                    ]
                  },
                  "contact_user": {
                    "type": "string",
                    "nullable": true
                  },
                  "from_domain": {
                    "type": "string",
                    "nullable": true
                  },
                  "from_user": {
                    "type": "string",
                    "nullable": true
                  },
                  "trust_id_inbound": {
                    "type": "string",
                    "enum": [
                      "yes",
                      "no"
                    ]
                  },
                  "send_pai": {
                    "type": "string",
                    "enum": [
                      "yes",
                      "no"
                    ]
                  },
                  "send_rpid": {
                    "type": "string",
                    "enum": [
                      "yes",
                      "no"
                    ]
                  },
                  "inband_progress": {
                    "type": "string",
                    "enum": [
                      "yes",
                      "no"
                    ]
                  },
                  "direct_media": {
                    "type": "string",
                    "enum": [
                      "yes",
                      "no"
                    ]
                  },
                  "rewrite_contact": {
                    "type": "string",
                    "enum": [
                      "yes",
                      "no"
                    ]
                  },
                  "rtp_symmetric": {
                    "type": "string",
                    "enum": [
                      "yes",
                      "no"
                    ]
                  },
                  "media_encryption": {
                    "type": "string",
                    "enum": [
                      "no",
                      "sdes",
                      "dtls"
                    ]
                  },
                  "force_rport": {
                    "type": "string",
                    "enum": [
                      "yes",
                      "no"
                    ]
                  },
                  "disallow": {
                    "type": "string",
                    "example": "all"
                  },
                  "allow": {
                    "type": "string",
                    "example": "alaw,ulaw,g729"
                  },
                  "rel100": {
                    "type": "string",
                    "nullable": true,
                    "enum": [
                      "no",
                      "required",
                      "peer_supported",
                      "yes"
                    ]
                  },
                  "rtp_timeout": {
                    "type": "integer",
                    "example": 120,
                    "minimum": 0
                  },
                  "inbound_identification": {
                    "type": "string",
                    "nullable": true,
                    "enum": [
                      "by_caller_number",
                      "by_called_number"
                    ]
                  },
                  "inbound_pattern": {
                    "description": "Required when inbound_identification=by_called_number; the prefix must be one of GET /v1/trunks/available-prefixes",
                    "properties": {
                      "prefix": {
                        "type": "string",
                        "example": "15077"
                      },
                      "min_digits": {
                        "type": "integer",
                        "example": 1,
                        "maximum": 15,
                        "minimum": 1
                      },
                      "max_digits": {
                        "type": "integer",
                        "example": 11,
                        "maximum": 15,
                        "minimum": 1
                      }
                    },
                    "type": "object",
                    "nullable": true
                  }
                },
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/TrunkCreated"
                    },
                    "message": {
                      "type": "string",
                      "example": "Trunk created successfully."
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission, or no phone line package owned",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "No PBX found for the organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "The trunk name is already taken",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation error, unavailable prefix, or phone line quota exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded, another create in progress, or the PBX trunk limit for the organization reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "The PBX is unreachable, or no PBX tenant is assigned to the organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/trunks/available-prefixes": {
      "get": {
        "tags": [
          "Trunks"
        ],
        "summary": "List prefixes available for by-called-number trunks",
        "description": "Prefixes that can be sent as `prefix` to POST /v1/trunks/by-called-number. A prefix is reserved when a trunk is created with it and released when that trunk is deleted. Requires `api_user|trunk_view`.",
        "operationId": "listTrunkAvailablePrefixes",
        "responses": {
          "200": {
            "description": "Available prefixes",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "example": [
                        "15077",
                        "15078"
                      ]
                    },
                    "message": {
                      "type": "string",
                      "example": "Success."
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "The PBX is unreachable, or no PBX tenant is assigned to the organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/trunks/{id}": {
      "get": {
        "tags": [
          "Trunks"
        ],
        "summary": "Get a trunk",
        "description": "The SIP secret is never returned. Requires `api_user|trunk_view`.",
        "operationId": "getTrunk",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "PBX trunk id; NOT an obfuscated hash id",
            "required": true,
            "schema": {
              "type": "integer",
              "example": 1042
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Trunk",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/Trunk"
                    },
                    "message": {
                      "type": "string",
                      "example": "Success."
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The trunk does not exist, or belongs to another organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "The PBX is unreachable, or no PBX tenant is assigned to the organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "put": {
        "tags": [
          "Trunks"
        ],
        "summary": "Update a trunk",
        "description": "Partial update: only the fields sent change, every other field keeps its stored value; at least one field is required. `contact_user`, `from_domain`, `from_user`, `direct_media` and `media_encryption` can be cleared with null; `host`, `port` and `secret` cannot. `name`, `type`, `inbound_identification` and `inbound_pattern.prefix` cannot be changed and are rejected with 422, as are the engine fields. On `fct` and `fctmvno` trunks only the codec and call settings (allow, disallow, media_encryption, rel100, rtp_timeout, user_eq_phone, trust_id_inbound, send_pai, send_rpid, inband_progress) can change and any other field returns 422. Returns the updated trunk without its secret. Requires `api_user|trunk_update`.",
        "operationId": "updateTrunk",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "PBX trunk id; NOT an obfuscated hash id",
            "required": true,
            "schema": {
              "type": "integer",
              "example": 1042
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "description": "Any field of POST /v1/trunks except name, type and inbound_identification",
                "properties": {
                  "secret": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "host": {
                    "type": "string",
                    "maxLength": 255
                  },
                  "port": {
                    "type": "integer",
                    "maximum": 65535,
                    "minimum": 1
                  },
                  "register": {
                    "type": "boolean"
                  },
                  "permit": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/TrunkPermitEntry"
                    },
                    "maxItems": 20,
                    "minItems": 1
                  },
                  "callerid": {
                    "type": "string",
                    "nullable": true
                  },
                  "allow": {
                    "type": "string",
                    "example": "alaw,ulaw",
                    "nullable": true
                  },
                  "inbound_pattern": {
                    "description": "Digit bounds of a by-called-number trunk; the prefix itself cannot change",
                    "properties": {
                      "min_digits": {
                        "type": "integer",
                        "maximum": 15,
                        "minimum": 1
                      },
                      "max_digits": {
                        "type": "integer",
                        "maximum": 15,
                        "minimum": 1
                      }
                    },
                    "type": "object"
                  }
                },
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Updated trunk",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/Trunk"
                    },
                    "message": {
                      "type": "string",
                      "example": "Trunk updated successfully."
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The trunk does not exist, or belongs to another organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation error, nothing to update, or a locked field on an fct/fctmvno trunk",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "The PBX is unreachable, or no PBX tenant is assigned to the organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      },
      "delete": {
        "tags": [
          "Trunks"
        ],
        "summary": "Delete a trunk",
        "description": "Deletes the trunk with its routes on the PBX; a by-called-number prefix goes back to the available pool. `fct` and `fctmvno` trunks are bound to an FCT device and return 403. Requires `api_user|trunk_delete`.",
        "operationId": "deleteTrunk",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "PBX trunk id; NOT an obfuscated hash id",
            "required": true,
            "schema": {
              "type": "integer",
              "example": 1042
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "object",
                      "example": null,
                      "nullable": true
                    },
                    "message": {
                      "type": "string",
                      "example": "Trunk deleted successfully."
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission, or an fct/fctmvno trunk",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "The trunk does not exist, or belongs to another organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "The PBX is unreachable, or no PBX tenant is assigned to the organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/trunks/outbound": {
      "post": {
        "tags": [
          "Trunks"
        ],
        "summary": "Create an outbound trunk with minimal fields",
        "description": "Only `name`, `host` and `permit` are required. Without `secret` a strong random one is generated and returned once in the response. `port` defaults to 5060 and `transport` to `transport-udp`; every other setting keeps the PBX default. `type` is not accepted: it is `netgsm` for Netgsm hosts and `custom` otherwise. `type`, `inbound_identification`, `inbound_pattern` and the engine fields are rejected with 422. Creating a trunk is capped by the number of phone line packages the organization owns; every existing trunk except `fct` ones counts against it (`fctmvno` counts). No phone line package returns 403 (also when the package check cannot be completed); a full quota returns 422, and a second create running for the same organization returns 429 after waiting up to 5 seconds. A 429 is also returned when the PBX trunk limit for the organization is reached. Requires `api_user|trunk_create`.",
        "operationId": "createOutboundTrunk",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "name",
                  "host",
                  "permit"
                ],
                "properties": {
                  "name": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9+]+$",
                    "example": "TRUNK1001",
                    "maxLength": 50
                  },
                  "host": {
                    "type": "string",
                    "example": "sip.example.com",
                    "maxLength": 255
                  },
                  "permit": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/TrunkPermitEntry"
                    },
                    "maxItems": 20,
                    "minItems": 1
                  },
                  "secret": {
                    "type": "string",
                    "nullable": true,
                    "maxLength": 255
                  },
                  "port": {
                    "type": "integer",
                    "example": 5060,
                    "maximum": 65535,
                    "minimum": 1
                  },
                  "transport": {
                    "type": "string",
                    "example": "transport-udp"
                  }
                },
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/TrunkCreated"
                    },
                    "message": {
                      "type": "string",
                      "example": "Trunk created successfully."
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission, or no phone line package owned",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "The trunk name is already taken",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation error or phone line quota exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded, another create in progress, or the PBX trunk limit for the organization reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "The PBX is unreachable, or no PBX tenant is assigned to the organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/trunks/by-called-number": {
      "post": {
        "tags": [
          "Trunks"
        ],
        "summary": "Create an inbound trunk matched by the called number",
        "description": "Inbound calls whose called number starts with `prefix` and is `min_digits`..`max_digits` long land on this trunk. `prefix` must be one of GET /v1/trunks/available-prefixes; an unavailable one returns 422. `name` is required. Without `host` the PBX uses the Netgsm SIP server and fills `permit` itself, as it does whenever the host is the Netgsm SIP server; any other host requires `permit`. `port` defaults to 5060. Without `secret` a strong random one is generated and returned once. `type` is not accepted: it is `netgsm` for Netgsm hosts and `custom` otherwise. Creating a trunk is capped by the number of phone line packages the organization owns; every existing trunk except `fct` ones counts against it (`fctmvno` counts). No phone line package returns 403 (also when the package check cannot be completed); a full quota returns 422, and a second create running for the same organization returns 429 after waiting up to 5 seconds. A 429 is also returned when the PBX trunk limit for the organization is reached. Requires `api_user|trunk_create`.",
        "operationId": "createByCalledNumberTrunk",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "prefix",
                  "min_digits",
                  "max_digits",
                  "name"
                ],
                "properties": {
                  "prefix": {
                    "type": "string",
                    "example": "15077"
                  },
                  "min_digits": {
                    "type": "integer",
                    "example": 1,
                    "maximum": 15,
                    "minimum": 1
                  },
                  "max_digits": {
                    "description": "Must be greater than or equal to min_digits",
                    "type": "integer",
                    "example": 11,
                    "maximum": 15,
                    "minimum": 1
                  },
                  "name": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9+]+$",
                    "maxLength": 50
                  },
                  "host": {
                    "type": "string",
                    "nullable": true,
                    "maxLength": 255
                  },
                  "secret": {
                    "type": "string",
                    "nullable": true,
                    "maxLength": 255
                  },
                  "port": {
                    "type": "integer",
                    "example": 5060,
                    "maximum": 65535,
                    "minimum": 1
                  },
                  "permit": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/TrunkPermitEntry"
                    },
                    "maxItems": 20,
                    "minItems": 1
                  }
                },
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/TrunkCreated"
                    },
                    "message": {
                      "type": "string",
                      "example": "Trunk created successfully."
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission, or no phone line package owned",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "The trunk name is already taken",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation error, unavailable prefix, or phone line quota exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded, another create in progress, or the PBX trunk limit for the organization reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "The PBX is unreachable, or no PBX tenant is assigned to the organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/trunks/by-caller-number": {
      "post": {
        "tags": [
          "Trunks"
        ],
        "summary": "Create an inbound trunk matched by the caller number",
        "description": "Inbound calls from `number` land on this trunk; the number becomes the trunk name, so `name` is rejected. `host` and `permit` are required. Without `secret` a strong random one is generated and returned once. `port` defaults to 5060. `type` is not accepted: it is `netgsm` for Netgsm hosts and `custom` otherwise. Creating a trunk is capped by the number of phone line packages the organization owns; every existing trunk except `fct` ones counts against it (`fctmvno` counts). No phone line package returns 403 (also when the package check cannot be completed); a full quota returns 422, and a second create running for the same organization returns 429 after waiting up to 5 seconds. A 429 is also returned when the PBX trunk limit for the organization is reached. Requires `api_user|trunk_create`.",
        "operationId": "createByCallerNumberTrunk",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "required": [
                  "number",
                  "host",
                  "permit"
                ],
                "properties": {
                  "number": {
                    "type": "string",
                    "pattern": "^\\+?[0-9]+$",
                    "example": "8503020419",
                    "maxLength": 50
                  },
                  "host": {
                    "type": "string",
                    "example": "sip.example.com",
                    "maxLength": 255
                  },
                  "permit": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/TrunkPermitEntry"
                    },
                    "maxItems": 20,
                    "minItems": 1
                  },
                  "secret": {
                    "type": "string",
                    "nullable": true,
                    "maxLength": 255
                  },
                  "port": {
                    "type": "integer",
                    "example": 5060,
                    "maximum": 65535,
                    "minimum": 1
                  }
                },
                "type": "object"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/TrunkCreated"
                    },
                    "message": {
                      "type": "string",
                      "example": "Trunk created successfully."
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission, or no phone line package owned",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "409": {
            "description": "A trunk with this number is already registered",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation error or phone line quota exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded, another create in progress, or the PBX trunk limit for the organization reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "503": {
            "description": "The PBX is unreachable, or no PBX tenant is assigned to the organization",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/users": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "List organization users",
        "description": "Paginated list of the API key's organization users. Filters: name, email, is_active, and a generic `search`. Authenticated by API key.",
        "operationId": "listUsers",
        "parameters": [
          {
            "name": "name",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "email",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "is_active",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size (default 15, max 100)",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated users",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/OrganizationUser"
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    },
    "/v1/users/{id}": {
      "get": {
        "tags": [
          "Users"
        ],
        "summary": "Show an organization user",
        "description": "Returns a single user of the API key's organization. The returned fields are identical to the list endpoint. Users outside the API key's organization return 404 (never 403), so ids cannot be probed for existence. Requires `api_user|user_view`.",
        "operationId": "getUser",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "description": "Obfuscated user id",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "User",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "status": {
                      "type": "boolean",
                      "example": true
                    },
                    "data": {
                      "$ref": "#/components/schemas/OrganizationUser"
                    }
                  },
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Unauthenticated",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Missing permission",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "Account": {
        "properties": {
          "id": {
            "description": "Obfuscated account id",
            "type": "string",
            "example": "q8Rk2Lm9p"
          },
          "name": {
            "type": "string",
            "example": "Ada"
          },
          "surname": {
            "type": "string",
            "example": "Lovelace",
            "nullable": true
          },
          "email": {
            "type": "string",
            "example": "ada@example.com"
          },
          "profile_picture": {
            "type": "string",
            "nullable": true
          },
          "last_login_date": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "type": "object"
      },
      "ApiClient": {
        "properties": {
          "id": {
            "description": "Obfuscated API user id",
            "type": "string",
            "example": "q8Rk2Lm9p"
          },
          "organization_id": {
            "description": "Obfuscated organization id",
            "type": "string",
            "example": "a1Bc3Df5g"
          },
          "name": {
            "type": "string",
            "example": "Billing integration",
            "nullable": true
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          }
        },
        "type": "object"
      },
      "AutodialerRecordImportResult": {
        "description": "Outcome of a single record import. A batch is not all-or-nothing: `accepted` and `rejected` together account for every record sent, so a partially accepted batch still returns 200.",
        "properties": {
          "accepted": {
            "description": "Records written to the list",
            "type": "integer",
            "example": 2
          },
          "rejected": {
            "description": "Records the campaign engine refused (invalid number, duplicate under on_duplicate=skip, ...)",
            "type": "integer",
            "example": 0
          },
          "rejected_detail": {
            "description": "One entry per rejected record, describing why it was refused; the entry shape is set by the campaign engine and is passed through unchanged. Empty when nothing was rejected.",
            "type": "array",
            "items": {
              "type": "object"
            },
            "example": []
          },
          "with_sipheader": {
            "description": "How many accepted records carried a `sipheader` object",
            "type": "integer",
            "example": 1
          },
          "sipheader_storage": {
            "description": "Where the campaign engine stored the sip headers",
            "type": "string",
            "example": "payload"
          }
        },
        "type": "object"
      },
      "Break": {
        "properties": {
          "id": {
            "description": "Obfuscated break id",
            "type": "string",
            "example": "a1Bc3Df5g"
          },
          "name": {
            "type": "string",
            "example": "Lunch"
          },
          "description": {
            "type": "string",
            "example": "Lunch break",
            "nullable": true
          },
          "color": {
            "description": "7-char hex color",
            "type": "string",
            "example": "#FF5733",
            "nullable": true
          },
          "duration": {
            "description": "Duration in seconds",
            "type": "integer",
            "example": 900
          },
          "status": {
            "type": "boolean",
            "example": true
          },
          "is_system": {
            "description": "System breaks are read-only",
            "type": "boolean",
            "example": false
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "type": "object"
      },
      "CallDetailReport": {
        "description": "One call in the call detail report. A field the upstream report does not carry for a given call is omitted rather than returned as null.",
        "properties": {
          "linkedid": {
            "description": "Stable call identifier; use it to correlate rows",
            "type": "string",
            "example": "1747900001.12345"
          },
          "call_date": {
            "type": "string",
            "format": "date",
            "example": "2026-05-18"
          },
          "call_start_time": {
            "type": "string",
            "format": "date-time",
            "example": "2026-05-18 09:14:22"
          },
          "call_end_time": {
            "type": "string",
            "format": "date-time",
            "example": "2026-05-18 09:17:05",
            "nullable": true
          },
          "src": {
            "description": "Calling number",
            "type": "string",
            "example": "5301234567",
            "nullable": true
          },
          "dst": {
            "description": "Called number",
            "type": "string",
            "example": "8503020419",
            "nullable": true
          },
          "calleridname": {
            "type": "string",
            "nullable": true
          },
          "direction": {
            "type": "string",
            "nullable": true,
            "enum": [
              "in",
              "out"
            ]
          },
          "call_type": {
            "type": "string",
            "example": "INBOUND_QUEUE",
            "nullable": true
          },
          "queue_name": {
            "type": "string",
            "nullable": true
          },
          "queue_wait_sec": {
            "description": "Seconds spent waiting in queue",
            "type": "integer",
            "nullable": true
          },
          "agent_talk_sec": {
            "type": "integer",
            "nullable": true
          },
          "total_duration_sec": {
            "type": "integer",
            "nullable": true
          },
          "disposition_class": {
            "type": "string",
            "example": "ANSWERED",
            "nullable": true
          },
          "answered_by_rid": {
            "description": "Agent record id that answered",
            "type": "string",
            "nullable": true
          },
          "answered_by_name": {
            "type": "string",
            "nullable": true
          },
          "is_transferred": {
            "type": "boolean",
            "nullable": true
          },
          "hangup_source": {
            "type": "string",
            "nullable": true
          },
          "sla_threshold_sec": {
            "type": "integer",
            "nullable": true
          },
          "hold_sec": {
            "type": "integer",
            "nullable": true
          },
          "handle_sec": {
            "type": "integer",
            "nullable": true
          },
          "wrap_sec": {
            "type": "integer",
            "nullable": true
          },
          "transfer_path": {
            "type": "string",
            "nullable": true
          },
          "queue_path": {
            "type": "string",
            "nullable": true
          },
          "survey_score": {
            "description": "Post-call survey score",
            "type": "integer",
            "nullable": true
          },
          "caller_segment": {
            "type": "string",
            "nullable": true
          },
          "is_repeat_call_24h": {
            "type": "boolean",
            "nullable": true
          },
          "transferred_count": {
            "type": "integer",
            "nullable": true
          },
          "queue_count": {
            "description": "How many queues the call passed through",
            "type": "integer",
            "nullable": true
          },
          "ivr_duration_sec": {
            "type": "integer",
            "nullable": true
          },
          "scenario_chain": {
            "description": "Signature of the routing path the call took",
            "type": "string",
            "nullable": true
          }
        },
        "type": "object"
      },
      "CallScript": {
        "properties": {
          "id": {
            "description": "Obfuscated call script id",
            "type": "string",
            "example": "a1Bc3Df5g"
          },
          "name": {
            "type": "string",
            "example": "Outbound sales opener"
          },
          "description": {
            "type": "string",
            "example": "Script for first-contact sales calls",
            "nullable": true
          },
          "is_active": {
            "type": "boolean",
            "example": true
          },
          "steps": {
            "type": "array",
            "items": {
              "properties": {
                "id": {
                  "type": "string",
                  "example": "q8Rk2Lm9p"
                },
                "order": {
                  "type": "integer",
                  "example": 0
                },
                "label": {
                  "type": "string",
                  "example": "Greeting"
                },
                "text": {
                  "type": "string",
                  "example": "Hello, thank you for taking the call..."
                },
                "quote": {
                  "type": "string",
                  "nullable": true
                }
              },
              "type": "object"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "type": "object"
      },
      "ContactGroup": {
        "properties": {
          "id": {
            "type": "string",
            "example": "q8Rk2Lm9p"
          },
          "name": {
            "type": "string",
            "example": "VIP"
          }
        },
        "type": "object"
      },
      "Contact": {
        "properties": {
          "id": {
            "description": "Obfuscated contact id",
            "type": "string",
            "example": "a1Bc3Df5g"
          },
          "name": {
            "type": "string",
            "example": "Ada Lovelace"
          },
          "email": {
            "type": "string",
            "example": "ada@example.com",
            "nullable": true
          },
          "phone_numbers": {
            "type": "array",
            "items": {
              "type": "string",
              "example": "+905321234567"
            }
          },
          "address": {
            "type": "string",
            "nullable": true
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "is_blacklisted": {
            "type": "boolean",
            "example": false
          },
          "groups": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ContactGroup"
            }
          },
          "form_values": {
            "description": "Custom (dynamic-form) field values",
            "type": "object"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "type": "object"
      },
      "ContactForm": {
        "properties": {
          "form": {
            "properties": {
              "id": {
                "description": "Obfuscated form id",
                "type": "string",
                "example": "a1Bc3Df5g"
              },
              "name": {
                "type": "string",
                "example": "Contact Form"
              },
              "slug": {
                "type": "string",
                "example": "contact-form"
              }
            },
            "type": "object",
            "nullable": true
          },
          "columns": {
            "description": "The contact's own columns. Used on the ticket list as `contact[<key>]`.",
            "type": "array",
            "items": {
              "properties": {
                "key": {
                  "type": "string",
                  "example": "name"
                },
                "match": {
                  "description": "How the value is matched",
                  "type": "string",
                  "enum": [
                    "contains",
                    "phone",
                    "boolean"
                  ]
                },
                "filterable": {
                  "type": "boolean",
                  "example": true
                },
                "operators": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "example": "eq"
                  }
                }
              },
              "type": "object"
            }
          },
          "fields": {
            "description": "Dynamic (custom) form fields. Used on the ticket list as `contact_form[<key>]`.",
            "type": "array",
            "items": {
              "properties": {
                "key": {
                  "type": "string",
                  "example": "t_puan"
                },
                "label": {
                  "type": "string",
                  "example": "Puan"
                },
                "type": {
                  "type": "string",
                  "example": "number",
                  "nullable": true
                },
                "required": {
                  "type": "boolean",
                  "example": false
                },
                "options": {
                  "type": "array",
                  "items": {
                    "type": "object"
                  }
                },
                "filterable": {
                  "type": "boolean",
                  "example": true
                },
                "operators": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "example": "eq"
                  }
                }
              },
              "type": "object"
            }
          }
        },
        "type": "object"
      },
      "ContactGroupDetail": {
        "properties": {
          "id": {
            "description": "Obfuscated contact group id",
            "type": "string",
            "example": "q8Rk2Lm9p"
          },
          "name": {
            "type": "string",
            "example": "VIP"
          },
          "description": {
            "type": "string",
            "example": "Priority customers",
            "nullable": true
          },
          "contacts_count": {
            "type": "integer",
            "example": 42
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "type": "object"
      },
      "ContactGroupContactIds": {
        "required": [
          "contact_ids"
        ],
        "properties": {
          "contact_ids": {
            "type": "array",
            "items": {
              "description": "Obfuscated contact id",
              "type": "string"
            },
            "example": [
              "a1Bc3Df5g",
              "h7Jk9Lm2n"
            ],
            "maxItems": 100,
            "minItems": 1
          }
        },
        "type": "object"
      },
      "CrmAgentLoginRequest": {
        "description": "Adds one or more extensions (`exten`) as members of one or more queues (`queue`). Both fields accept a comma-separated list.",
        "required": [
          "crm_id",
          "exten",
          "queue",
          "penalty",
          "paused"
        ],
        "properties": {
          "crm_id": {
            "description": "Client-supplied operation id; echoed back verbatim.",
            "type": "string",
            "example": "req-3002"
          },
          "exten": {
            "description": "Comma-separated extension list.",
            "type": "string",
            "example": "101,102"
          },
          "queue": {
            "description": "Comma-separated queue name list (short form).",
            "type": "string",
            "example": "sales,support"
          },
          "penalty": {
            "description": "Priority (penalty) value within the queue.",
            "type": "string",
            "example": "0"
          },
          "paused": {
            "description": "Pause state to apply once the member is added.",
            "type": "string",
            "enum": [
              "0",
              "1"
            ]
          }
        },
        "type": "object"
      },
      "CrmAgentLogoffRequest": {
        "description": "Removes one or more extensions (`exten`) as members of one or more queues (`queue`).",
        "required": [
          "crm_id",
          "exten",
          "queue"
        ],
        "properties": {
          "crm_id": {
            "description": "Client-supplied operation id; echoed back verbatim.",
            "type": "string",
            "example": "req-3003"
          },
          "exten": {
            "description": "Comma-separated extension list.",
            "type": "string"
          },
          "queue": {
            "description": "Comma-separated queue name list (short form).",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CrmAgentPauseRequest": {
        "description": "Pauses or unpauses an agent on one or more queues. `paused` = `1` pauses the agent, `0` unpauses. Turkish characters in `reason` are ASCII-folded upstream.",
        "required": [
          "crm_id",
          "exten",
          "queue",
          "paused",
          "reason"
        ],
        "properties": {
          "crm_id": {
            "description": "Client-supplied operation id; echoed back verbatim.",
            "type": "string",
            "example": "req-3004"
          },
          "exten": {
            "description": "Comma-separated extension list.",
            "type": "string"
          },
          "queue": {
            "description": "Comma-separated queue name list (short form).",
            "type": "string"
          },
          "paused": {
            "description": "1 = pause, 0 = unpause.",
            "type": "string",
            "enum": [
              "0",
              "1"
            ]
          },
          "reason": {
            "description": "Pause reason.",
            "type": "string",
            "example": "lunch"
          }
        },
        "type": "object"
      },
      "CrmAtXferRequest": {
        "description": "Attended-transfers the active call to `exten`, consulting the target extension before completing the transfer.",
        "required": [
          "crm_id",
          "unique_id",
          "exten"
        ],
        "properties": {
          "crm_id": {
            "description": "Client-supplied operation id; echoed back verbatim.",
            "type": "string",
            "example": "req-2003"
          },
          "unique_id": {
            "description": "Unique id of the call to transfer.",
            "type": "string"
          },
          "exten": {
            "description": "Target extension to consult and transfer to.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CrmBaseResponse": {
        "required": [
          "status",
          "message"
        ],
        "properties": {
          "crm_id": {
            "description": "Operation id sent in the request.",
            "type": "string"
          },
          "response": {
            "description": "Name of the command that produced this response.",
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "Success",
              "Error"
            ]
          },
          "message": {
            "description": "Human-readable description.",
            "type": "string"
          },
          "code": {
            "description": "Application error code (see schema description).",
            "type": "string",
            "enum": [
              "30",
              "50",
              "70",
              "90"
            ]
          }
        },
        "type": "object"
      },
      "CrmCallResponse": {
        "required": [
          "status",
          "message"
        ],
        "properties": {
          "crm_id": {
            "description": "Operation id sent in the request.",
            "type": "string"
          },
          "response": {
            "description": "Name of the command that produced this response.",
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "Success",
              "Error"
            ]
          },
          "message": {
            "description": "Human-readable description.",
            "type": "string"
          },
          "code": {
            "description": "Application error code (see CrmBaseResponse description).",
            "type": "string",
            "enum": [
              "30",
              "50",
              "70",
              "90"
            ]
          },
          "unique_id": {
            "description": "Unique id of the created call (null on error).",
            "type": "string",
            "nullable": true
          },
          "caller_num": {
            "description": "Calling number.",
            "type": "string"
          },
          "called_num": {
            "description": "Called number.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CrmConferenceListRequest": {
        "description": "Queries whether the named conference room exists/is active over AMI. The participant list itself is not returned, only the query result.",
        "required": [
          "crm_id",
          "conferencename"
        ],
        "properties": {
          "crm_id": {
            "description": "Client-supplied operation id; echoed back verbatim.",
            "type": "string",
            "example": "req-4001"
          },
          "conferencename": {
            "description": "Conference room name.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CrmDynamicRedirectRequest": {
        "description": "Dials `called` and bridges the call to the target named by `redirect_type` + `redirect_menu`. The full target name is derived upstream: `queue` -> `{hizmetNumarasi}-queue-{redirect_menu}`, `announcement` -> `{hizmetNumarasi}-announcement-{redirect_menu}`, `ivr` -> `{redirect_menu}-{hizmetNumarasi}`. If the target or trunk is not defined on the PBX, the response has `code: \"70\"`. If `brandcode` and `filter` are both sent, an IYS permission check runs first; a number without permission returns `code: \"50\"` (IYS RED) and the call is not placed.",
        "required": [
          "crm_id",
          "called",
          "redirect_menu",
          "redirect_type",
          "ring_timeout",
          "wait_response",
          "trunk"
        ],
        "properties": {
          "crm_id": {
            "description": "Client-supplied operation id; echoed back verbatim.",
            "type": "string",
            "example": "req-1004"
          },
          "called": {
            "description": "Number to call.",
            "type": "string"
          },
          "redirect_menu": {
            "description": "Target menu/queue/IVR name (short form).",
            "type": "string"
          },
          "redirect_type": {
            "description": "Target type; determines how the full upstream target name is derived.",
            "type": "string",
            "enum": [
              "queue",
              "announcement",
              "ivr"
            ]
          },
          "ring_timeout": {
            "description": "Ring duration in seconds.",
            "type": "integer"
          },
          "wait_response": {
            "description": "Answer wait duration in seconds.",
            "type": "integer"
          },
          "trunk": {
            "description": "Trunk name the call goes out on.",
            "type": "string"
          },
          "prefix": {
            "description": "Call prefix. If longer than 5 characters, only its first 4 characters are used.",
            "type": "string",
            "maxLength": 4
          },
          "callerid": {
            "description": "Calling number to present on the call.",
            "type": "string"
          },
          "caller_text": {
            "description": "Text to be read out (TTS) to the caller side.",
            "type": "string"
          },
          "called_text": {
            "description": "Text to be read out (TTS) to the called side.",
            "type": "string"
          },
          "caller_record": {
            "description": "Name of a recorded prompt to play to the caller side.",
            "type": "string"
          },
          "called_record": {
            "description": "Name of a recorded prompt to play to the called side.",
            "type": "string"
          },
          "brandcode": {
            "description": "IYS brand code (must be sent together with `filter`).",
            "type": "string"
          },
          "filter": {
            "description": "IYS recipient-type filter (must be sent together with `brandcode`).",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "CrmHangupRequest": {
        "description": "Hangs up the call identified by `unique_id`. netcrm first tries the last channel of the call, then falls back to the first channel if that fails.",
        "required": [
          "crm_id",
          "unique_id"
        ],
        "properties": {
          "crm_id": {
            "description": "Client-supplied operation id; echoed back verbatim.",
            "type": "string",
            "example": "req-2001"
          },
          "unique_id": {
            "description": "Unique id of the call to hang up.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CrmLinkupRequest": {
        "description": "Bridges two free-form numbers (`caller` and `called`) over a trunk. Unlike `originate`, either side may be an outside number.",
        "required": [
          "crm_id",
          "caller",
          "called",
          "ring_timeout",
          "wait_response",
          "originate_order",
          "trunk"
        ],
        "properties": {
          "crm_id": {
            "description": "Client-supplied operation id; echoed back verbatim.",
            "type": "string",
            "example": "req-1002"
          },
          "caller": {
            "description": "Calling party number.",
            "type": "string"
          },
          "called": {
            "description": "Called party number.",
            "type": "string"
          },
          "ring_timeout": {
            "description": "Ring duration in seconds.",
            "type": "integer"
          },
          "wait_response": {
            "description": "Answer wait duration in seconds.",
            "type": "integer"
          },
          "originate_order": {
            "description": "`if` = the first party is dialed first, `of` = the second party is dialed first.",
            "type": "string",
            "enum": [
              "if",
              "of"
            ]
          },
          "trunk": {
            "description": "Trunk name the call goes out on.",
            "type": "string"
          },
          "call_time": {
            "description": "Maximum talk duration in seconds.",
            "type": "integer",
            "default": 5400
          },
          "caller_text": {
            "description": "Text to be read out (TTS) to the caller side.",
            "type": "string"
          },
          "called_text": {
            "description": "Text to be read out (TTS) to the called side.",
            "type": "string"
          },
          "caller_record": {
            "description": "Name of a recorded prompt to play to the caller side.",
            "type": "string"
          },
          "called_record": {
            "description": "Name of a recorded prompt to play to the called side.",
            "type": "string"
          },
          "warning_file": {
            "description": "Warning audio file to play shortly before the call ends.",
            "type": "string"
          },
          "warning_remaining_second": {
            "description": "How many seconds before the call ends the warning is played.",
            "type": "integer",
            "default": 0
          }
        },
        "type": "object"
      },
      "CrmLocalRequest": {
        "description": "Dials two internal extensions of the same PBX against each other (no trunk involved).",
        "required": [
          "crm_id",
          "caller",
          "called",
          "ring_timeout",
          "wait_response"
        ],
        "properties": {
          "crm_id": {
            "description": "Client-supplied operation id; echoed back verbatim.",
            "type": "string",
            "example": "req-1003"
          },
          "caller": {
            "description": "Calling extension.",
            "type": "string"
          },
          "called": {
            "description": "Called extension.",
            "type": "string"
          },
          "ring_timeout": {
            "description": "Ring duration in seconds.",
            "type": "integer"
          },
          "wait_response": {
            "description": "Answer wait duration in seconds.",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "CrmMuteAudioRequest": {
        "description": "Mutes or unmutes one audio direction of the given call.",
        "required": [
          "crm_id",
          "unique_id",
          "direction",
          "state"
        ],
        "properties": {
          "crm_id": {
            "description": "Client-supplied operation id; echoed back verbatim.",
            "type": "string",
            "example": "req-2004"
          },
          "unique_id": {
            "description": "Unique id of the call.",
            "type": "string"
          },
          "direction": {
            "description": "Audio direction to mute/unmute.",
            "type": "string",
            "enum": [
              "in",
              "out",
              "all"
            ]
          },
          "state": {
            "description": "`on` mutes the audio, `off` unmutes it.",
            "type": "string",
            "enum": [
              "on",
              "off"
            ]
          }
        },
        "type": "object"
      },
      "CrmOriginateRequest": {
        "description": "Independently dials an internal extension and a customer number and bridges them once both answer.",
        "required": [
          "crm_id",
          "customer_num",
          "internal_num",
          "ring_timeout",
          "wait_response",
          "originate_order",
          "trunk"
        ],
        "properties": {
          "crm_id": {
            "description": "Client-supplied operation id; echoed back verbatim.",
            "type": "string",
            "example": "req-1001"
          },
          "customer_num": {
            "description": "Customer number to call.",
            "type": "string",
            "example": "5000000000"
          },
          "internal_num": {
            "description": "Internal extension that originates the call.",
            "type": "string",
            "example": "101"
          },
          "ring_timeout": {
            "description": "Ring duration in seconds.",
            "type": "integer",
            "example": 30
          },
          "wait_response": {
            "description": "Answer wait duration in seconds.",
            "type": "integer",
            "example": 30
          },
          "originate_order": {
            "description": "`if` = the internal extension is dialed first, `of` = the outside number is dialed first.",
            "type": "string",
            "enum": [
              "if",
              "of"
            ]
          },
          "trunk": {
            "description": "Trunk name the call goes out on.",
            "type": "string"
          },
          "call_time": {
            "description": "Maximum talk duration in seconds.",
            "type": "integer",
            "default": 5400
          },
          "hide_callerid": {
            "description": "1 hides the calling number.",
            "type": "integer",
            "default": 0,
            "enum": [
              0,
              1
            ]
          },
          "caller_text": {
            "description": "Text to be read out (TTS) to the caller side.",
            "type": "string"
          },
          "called_text": {
            "description": "Text to be read out (TTS) to the called side.",
            "type": "string"
          },
          "caller_record": {
            "description": "Name of a recorded prompt to play to the caller side.",
            "type": "string"
          },
          "called_record": {
            "description": "Name of a recorded prompt to play to the called side.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CrmPlayDtmfRequest": {
        "description": "Sends `digit` as DTMF tones, one digit at a time. If any digit fails to send, the operation aborts mid-way and returns an error naming that digit.",
        "required": [
          "crm_id",
          "unique_id",
          "direction",
          "digit"
        ],
        "properties": {
          "crm_id": {
            "description": "Client-supplied operation id; echoed back verbatim.",
            "type": "string",
            "example": "req-2005"
          },
          "unique_id": {
            "description": "Unique id of the call.",
            "type": "string"
          },
          "direction": {
            "description": "`in` = towards the caller side, `out` = towards the called side.",
            "type": "string",
            "enum": [
              "in",
              "out"
            ]
          },
          "digit": {
            "description": "DTMF digits to send.",
            "type": "string",
            "example": "1234#"
          }
        },
        "type": "object"
      },
      "CrmQueue": {
        "properties": {
          "queuename": {
            "description": "Full upstream queue name (`{hizmetNumarasi}-queue-{queue}`).",
            "type": "string"
          },
          "callers": {
            "description": "Calls waiting in the queue - key is the call, value is its wait time in seconds.",
            "type": "object",
            "additionalProperties": {
              "type": "integer"
            }
          },
          "agents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CrmQueueAgent"
            }
          },
          "calls": {
            "description": "Number of calls currently waiting.",
            "type": "integer"
          },
          "holdtime": {
            "description": "Average hold time in seconds.",
            "type": "integer"
          },
          "talktime": {
            "description": "Average talk time in seconds.",
            "type": "integer"
          },
          "completed": {
            "description": "Number of completed calls.",
            "type": "integer"
          },
          "abondaned": {
            "description": "Number of abandoned calls.",
            "type": "integer"
          },
          "max": {
            "description": "Queue's maximum capacity.",
            "type": "integer"
          }
        },
        "type": "object"
      },
      "CrmQueueAgent": {
        "properties": {
          "agent": {
            "description": "Agent's channel/extension.",
            "type": "string"
          },
          "status": {
            "description": "Agent's current status: `empty` = free, `onhook` = busy/on a call, `ringing` = phone is ringing, `onhold` = on hold, `unregister` = not registered, `invalid` = invalid.",
            "type": "string",
            "enum": [
              "empty",
              "onhook",
              "ringing",
              "onhold",
              "unregister",
              "invalid"
            ]
          },
          "membership": {
            "description": "Queue membership type (dynamic / static / realtime).",
            "type": "string"
          },
          "paused": {
            "description": "Whether paused (`true` / `false`).",
            "type": "string"
          },
          "reason": {
            "description": "Pause reason.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "CrmQueueStatsRequest": {
        "description": "Returns live status and statistics for the given queues. When `queue` is omitted, every queue on the PBX is listed. Queue names are given in their short form and are resolved upstream as `{hizmetNumarasi}-queue-{queue}`; if one of them does not exist, the response has `code: \"70\"`. If the AMI connection to the PBX cannot be established, `code: \"90\"` is returned.",
        "required": [
          "crm_id"
        ],
        "properties": {
          "crm_id": {
            "description": "Client-supplied operation id; echoed back verbatim.",
            "type": "string",
            "example": "req-3001"
          },
          "queue": {
            "description": "Comma-separated queue name list (short form). When omitted, all queues are listed.",
            "type": "string",
            "example": "sales,support"
          }
        },
        "type": "object"
      },
      "CrmQueueStatsResponse": {
        "required": [
          "pbx_num",
          "queues"
        ],
        "properties": {
          "crm_id": {
            "description": "Operation id sent in the request.",
            "type": "string"
          },
          "pbx_num": {
            "description": "PBX number.",
            "type": "string"
          },
          "queues": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CrmQueue"
            }
          }
        },
        "type": "object"
      },
      "CrmXferRequest": {
        "description": "Blind-transfers the active call to `exten` without consulting the other party first.",
        "required": [
          "crm_id",
          "unique_id",
          "exten"
        ],
        "properties": {
          "crm_id": {
            "description": "Client-supplied operation id; echoed back verbatim.",
            "type": "string",
            "example": "req-2002"
          },
          "unique_id": {
            "description": "Unique id of the call to transfer.",
            "type": "string"
          },
          "exten": {
            "description": "Target extension to transfer to.",
            "type": "string"
          }
        },
        "type": "object"
      },
      "ErrorResponse": {
        "properties": {
          "status": {
            "description": "Standard error envelope produced by ExceptionHandlerService.",
            "type": "boolean",
            "example": false
          },
          "message": {
            "type": "string",
            "example": "Unauthenticated."
          },
          "errors": {
            "type": "object"
          }
        },
        "type": "object"
      },
      "Interaction": {
        "properties": {
          "id": {
            "description": "Obfuscated interaction id",
            "type": "string",
            "example": "a1Bc3Df5g"
          },
          "interaction_type": {
            "type": "string",
            "example": "call",
            "enum": [
              "call",
              "chat",
              "email",
              "system",
              "voicemail"
            ]
          },
          "direction": {
            "type": "string",
            "example": "inbound",
            "enum": [
              "inbound",
              "outbound"
            ]
          },
          "status": {
            "description": "true = open, false = closed",
            "type": "boolean",
            "example": true
          },
          "started_at": {
            "type": "string",
            "format": "date-time"
          },
          "ended_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "contact": {
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "email": {
                "type": "string",
                "nullable": true
              },
              "phone_numbers": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "is_blacklisted": {
                "type": "boolean"
              }
            },
            "type": "object",
            "nullable": true
          },
          "channel": {
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "key": {
                "type": "string"
              },
              "icon": {
                "type": "string",
                "nullable": true
              }
            },
            "type": "object",
            "nullable": true
          },
          "users": {
            "description": "Participating agents",
            "type": "array",
            "items": {
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "role": {
                  "type": "string",
                  "nullable": true
                },
                "joined_at": {
                  "type": "string",
                  "format": "date-time",
                  "nullable": true
                },
                "left_at": {
                  "type": "string",
                  "format": "date-time",
                  "nullable": true
                }
              },
              "type": "object"
            }
          },
          "tickets": {
            "type": "array",
            "items": {
              "properties": {
                "id": {
                  "type": "string"
                },
                "ticket_key": {
                  "type": "string"
                }
              },
              "type": "object"
            }
          },
          "items": {
            "description": "Timeline entries (detail endpoint only)",
            "type": "array",
            "items": {
              "properties": {
                "id": {
                  "type": "string"
                },
                "item_type": {
                  "type": "string"
                },
                "source": {
                  "type": "string"
                },
                "content": {
                  "type": "string",
                  "nullable": true
                },
                "actor_type": {
                  "type": "string",
                  "nullable": true
                },
                "external_id": {
                  "type": "string",
                  "nullable": true
                },
                "metadata": {
                  "type": "object",
                  "nullable": true
                },
                "occurred_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "created_at": {
                  "type": "string",
                  "format": "date-time"
                }
              },
              "type": "object"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "type": "object"
      },
      "OrganizationUser": {
        "properties": {
          "id": {
            "description": "Obfuscated user id",
            "type": "string",
            "example": "a1Bc3Df5g"
          },
          "name": {
            "type": "string",
            "example": "Alan Turing"
          },
          "email": {
            "type": "string",
            "example": "alan@example.com"
          },
          "phone_number": {
            "type": "string",
            "nullable": true
          },
          "profile_picture": {
            "type": "string",
            "nullable": true
          },
          "is_active": {
            "type": "boolean",
            "example": true
          },
          "organization_id": {
            "type": "string",
            "example": "YZA6yBJB5"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "type": "object"
      },
      "ProjectMember": {
        "properties": {
          "id": {
            "description": "Obfuscated member id",
            "type": "string",
            "example": "q8Rk2Lm9p"
          },
          "type": {
            "type": "string",
            "example": "user",
            "enum": [
              "user",
              "account"
            ]
          },
          "name": {
            "type": "string",
            "example": "Ada Lovelace"
          },
          "email": {
            "type": "string",
            "example": "ada@example.com",
            "nullable": true
          },
          "profile_picture": {
            "type": "string",
            "nullable": true
          }
        },
        "type": "object"
      },
      "Project": {
        "properties": {
          "id": {
            "description": "Obfuscated project id",
            "type": "string",
            "example": "a1Bc3Df5g"
          },
          "name": {
            "type": "string",
            "example": "Support"
          },
          "key": {
            "type": "string",
            "example": "SUP"
          },
          "logo": {
            "type": "string",
            "nullable": true
          },
          "is_active": {
            "type": "boolean",
            "example": true
          },
          "organization_id": {
            "type": "string",
            "example": "YZA6yBJB5"
          },
          "manager": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ProjectMember"
              }
            ],
            "nullable": true
          },
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectMember"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "type": "object"
      },
      "QuickReply": {
        "properties": {
          "id": {
            "description": "Obfuscated quick-reply id",
            "type": "string",
            "example": "a1Bc3Df5g"
          },
          "title": {
            "type": "string",
            "example": "Karşılama mesajı"
          },
          "shortcut": {
            "description": "Shortcut, unique per organization",
            "type": "string",
            "example": "/merhaba",
            "nullable": true
          },
          "content": {
            "type": "string",
            "example": "Merhaba, size nasıl yardımcı olabilirim?"
          },
          "channel_keys": {
            "description": "Channels this reply applies to; empty means all",
            "type": "array",
            "items": {
              "type": "string",
              "example": "email"
            }
          },
          "is_active": {
            "type": "boolean",
            "example": true
          },
          "usage_count": {
            "description": "How many times the reply has been used",
            "type": "integer",
            "example": 0
          },
          "last_used_at": {
            "type": "string",
            "format": "date-time",
            "nullable": true
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "type": "object"
      },
      "Ticket": {
        "properties": {
          "id": {
            "description": "Obfuscated ticket id",
            "type": "string",
            "example": "a1Bc3Df5g"
          },
          "ticket_key": {
            "type": "string",
            "example": "SUP-42"
          },
          "ticket_number": {
            "type": "integer",
            "example": 42
          },
          "priority": {
            "type": "string",
            "example": "medium",
            "enum": [
              "low",
              "medium",
              "high"
            ]
          },
          "order": {
            "type": "number",
            "format": "float",
            "example": 1000
          },
          "project_id": {
            "type": "string",
            "example": "q8Rk2Lm9p"
          },
          "status": {
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "color": {
                "type": "string"
              }
            },
            "type": "object",
            "nullable": true
          },
          "assigned": {
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "type": "object",
            "nullable": true
          },
          "contact": {
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "phone_numbers": {
                "type": "array",
                "items": {
                  "type": "string",
                  "example": "+905321234567"
                }
              }
            },
            "type": "object",
            "nullable": true
          },
          "tags": {
            "type": "array",
            "items": {
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                },
                "color": {
                  "type": "string",
                  "nullable": true
                }
              },
              "type": "object"
            }
          },
          "form_values": {
            "description": "Custom (dynamic-form) field values",
            "type": "object"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "type": "object"
      },
      "TicketFormField": {
        "properties": {
          "key": {
            "description": "Value to use in the `form[<key>]` list filter",
            "type": "string",
            "example": "priority_level"
          },
          "label": {
            "description": "Falls back to `key` when the field has no title",
            "type": "string",
            "example": "Öncelik Seviyesi"
          },
          "type": {
            "description": "Dynamic-form field type (text, textarea, number, date, datetime, time, select, checkbox, radio, autocomplete, switch, file, hidden, tree_radio)",
            "type": "string",
            "example": "select",
            "nullable": true
          },
          "required": {
            "type": "boolean",
            "example": true
          },
          "options": {
            "description": "Selectable options; empty when the field has none",
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "filterable": {
            "description": "False for `file` fields in v1",
            "type": "boolean",
            "example": true
          },
          "operators": {
            "description": "Supported filter operators (empty when not filterable)",
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "eq",
                "in"
              ]
            }
          }
        },
        "type": "object"
      },
      "TicketForm": {
        "properties": {
          "form": {
            "description": "Null when the project has no form",
            "properties": {
              "id": {
                "description": "Obfuscated form id",
                "type": "string",
                "example": "a1Bc3Df5g"
              },
              "name": {
                "type": "string",
                "example": "Support ticket form"
              },
              "slug": {
                "type": "string",
                "example": "support-ticket-form"
              }
            },
            "type": "object",
            "nullable": true
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TicketFormField"
            }
          }
        },
        "type": "object"
      },
      "TicketStatus": {
        "properties": {
          "id": {
            "description": "Obfuscated status id",
            "type": "string",
            "example": "q8Rk2Lm9p"
          },
          "name": {
            "type": "string",
            "example": "Open"
          },
          "color": {
            "type": "string",
            "example": "#808390",
            "nullable": true
          },
          "order": {
            "type": "integer",
            "example": 1
          },
          "is_default": {
            "type": "boolean",
            "example": true
          }
        },
        "type": "object"
      },
      "TrunkPermitEntry": {
        "description": "One IPv4 range allowed to reach the trunk.",
        "required": [
          "ip",
          "subnet"
        ],
        "properties": {
          "ip": {
            "type": "string",
            "format": "ipv4",
            "example": "203.0.113.10"
          },
          "subnet": {
            "type": "integer",
            "example": 32,
            "maximum": 32,
            "minimum": 0
          }
        },
        "type": "object"
      },
      "Trunk": {
        "description": "A trunk as stored on the PBX. The SIP secret is never returned.",
        "properties": {
          "id": {
            "description": "PBX trunk id; NOT an obfuscated hash id",
            "type": "integer",
            "example": 1042
          },
          "name": {
            "type": "string",
            "example": "TRUNK_1001"
          },
          "type": {
            "description": "`fct` and `fctmvno` trunks are bound to an FCT device: they cannot be deleted, only their codec and call settings can be updated, and they carry only id, name, type and those settings (allow, disallow, media_encryption, rel100, rtp_timeout, user_eq_phone, trust_id_inbound, send_pai, send_rpid, inband_progress)",
            "type": "string",
            "example": "custom",
            "nullable": true,
            "enum": [
              "netgsm",
              "custom",
              "fct",
              "fctmvno"
            ]
          },
          "host": {
            "type": "string",
            "example": "sip.example.com"
          },
          "port": {
            "type": "string",
            "example": "5060"
          },
          "register": {
            "description": "1 when the trunk registers to its host",
            "type": "integer",
            "example": 0
          },
          "permit": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TrunkPermitEntry"
            }
          },
          "context": {
            "type": "string",
            "example": "from-outside",
            "nullable": true
          },
          "transport": {
            "type": "string",
            "example": "transport-udp",
            "nullable": true
          },
          "callerid": {
            "type": "string",
            "nullable": true
          },
          "user_eq_phone": {
            "type": "string",
            "nullable": true,
            "enum": [
              "yes",
              "no"
            ]
          },
          "contact_user": {
            "type": "string",
            "nullable": true
          },
          "from_domain": {
            "type": "string",
            "nullable": true
          },
          "from_user": {
            "type": "string",
            "nullable": true
          },
          "trust_id_inbound": {
            "type": "string",
            "nullable": true,
            "enum": [
              "yes",
              "no"
            ]
          },
          "send_pai": {
            "type": "string",
            "nullable": true,
            "enum": [
              "yes",
              "no"
            ]
          },
          "send_rpid": {
            "type": "string",
            "nullable": true,
            "enum": [
              "yes",
              "no"
            ]
          },
          "inband_progress": {
            "type": "string",
            "nullable": true,
            "enum": [
              "yes",
              "no"
            ]
          },
          "direct_media": {
            "type": "string",
            "nullable": true,
            "enum": [
              "yes",
              "no"
            ]
          },
          "rewrite_contact": {
            "type": "string",
            "nullable": true,
            "enum": [
              "yes",
              "no"
            ]
          },
          "rtp_symmetric": {
            "type": "string",
            "nullable": true,
            "enum": [
              "yes",
              "no"
            ]
          },
          "media_encryption": {
            "type": "string",
            "nullable": true,
            "enum": [
              "no",
              "sdes",
              "dtls"
            ]
          },
          "force_rport": {
            "type": "string",
            "nullable": true,
            "enum": [
              "yes",
              "no"
            ]
          },
          "disallow": {
            "type": "string",
            "example": "all",
            "nullable": true
          },
          "allow": {
            "type": "string",
            "example": "alaw,ulaw,g729,opus,g722,h263,h263p,h264",
            "nullable": true
          },
          "rel100": {
            "type": "string",
            "nullable": true,
            "enum": [
              "no",
              "required",
              "peer_supported",
              "yes"
            ]
          },
          "identification_mode": {
            "type": "string",
            "nullable": true,
            "enum": [
              "by_caller_number",
              "by_called_number"
            ]
          },
          "inbound_pattern": {
            "properties": {
              "prefix": {
                "type": "string",
                "example": "15077"
              },
              "min_digits": {
                "type": "integer",
                "example": 1
              },
              "max_digits": {
                "type": "integer",
                "example": 11
              }
            },
            "type": "object",
            "nullable": true
          },
          "registration_status": {
            "type": "string",
            "example": "Registered",
            "nullable": true
          }
        },
        "type": "object"
      },
      "TrunkCreated": {
        "description": "A newly created trunk. `secret` is present only when the server generated it, and this is the only response that ever carries it.",
        "properties": {
          "id": {
            "type": "integer",
            "example": 1042
          },
          "name": {
            "type": "string",
            "example": "TRUNK_1001"
          },
          "type": {
            "type": "string",
            "example": "custom",
            "enum": [
              "netgsm",
              "custom"
            ]
          },
          "secret": {
            "description": "Only when no secret was sent and one was generated",
            "type": "string",
            "example": "q8V0dZr3LkP1nW7sT2yB5mC9xH4jF6aE"
          }
        },
        "type": "object"
      }
    },
    "parameters": {
      "CrmHizmetNumarasi": {
        "name": "hizmetNumarasi",
        "in": "path",
        "description": "Your own organization's service no, verified by the `crm.service_no` middleware. Passing another organization's service no returns 403. Digits only.",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^[0-9]{6,25}$",
          "example": "120326001"
        }
      },
      "CrmCrmId": {
        "name": "crm_id",
        "in": "query",
        "description": "Client-supplied operation id; echoed back verbatim in the response, used to match a request to its response.",
        "required": true,
        "schema": {
          "type": "string",
          "example": "req-1001"
        }
      },
      "CrmCustomerNum": {
        "name": "customer_num",
        "in": "query",
        "description": "Customer number to call.",
        "required": true,
        "schema": {
          "type": "string",
          "example": "5000000000"
        }
      },
      "CrmInternalNum": {
        "name": "internal_num",
        "in": "query",
        "description": "Internal extension that originates the call.",
        "required": true,
        "schema": {
          "type": "string",
          "example": "101"
        }
      },
      "CrmRingTimeout": {
        "name": "ring_timeout",
        "in": "query",
        "description": "Ring duration in seconds.",
        "required": true,
        "schema": {
          "type": "integer",
          "example": 30
        }
      },
      "CrmWaitResponse": {
        "name": "wait_response",
        "in": "query",
        "description": "Answer wait duration in seconds.",
        "required": true,
        "schema": {
          "type": "integer",
          "example": 30
        }
      },
      "CrmOriginateOrder": {
        "name": "originate_order",
        "in": "query",
        "description": "`if` = the internal/first party is dialed first, `of` = the outside/second party is dialed first.",
        "required": true,
        "schema": {
          "type": "string",
          "enum": [
            "if",
            "of"
          ]
        }
      },
      "CrmTrunk": {
        "name": "trunk",
        "in": "query",
        "description": "Trunk name the call goes out on.",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "CrmCallTime": {
        "name": "call_time",
        "in": "query",
        "description": "Maximum talk duration in seconds.",
        "required": false,
        "schema": {
          "type": "integer",
          "default": 5400
        }
      },
      "CrmHideCallerId": {
        "name": "hide_callerid",
        "in": "query",
        "description": "1 hides the calling number.",
        "required": false,
        "schema": {
          "type": "integer",
          "default": 0,
          "enum": [
            0,
            1
          ]
        }
      },
      "CrmCallerText": {
        "name": "caller_text",
        "in": "query",
        "description": "Text to be read out (TTS) to the caller side.",
        "required": false,
        "schema": {
          "type": "string"
        }
      },
      "CrmCalledText": {
        "name": "called_text",
        "in": "query",
        "description": "Text to be read out (TTS) to the called side.",
        "required": false,
        "schema": {
          "type": "string"
        }
      },
      "CrmCallerRecord": {
        "name": "caller_record",
        "in": "query",
        "description": "Name of a recorded prompt to play to the caller side.",
        "required": false,
        "schema": {
          "type": "string"
        }
      },
      "CrmCalledRecord": {
        "name": "called_record",
        "in": "query",
        "description": "Name of a recorded prompt to play to the called side.",
        "required": false,
        "schema": {
          "type": "string"
        }
      },
      "CrmCaller": {
        "name": "caller",
        "in": "query",
        "description": "Calling party number.",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "CrmCalled": {
        "name": "called",
        "in": "query",
        "description": "Called party number.",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "CrmWarningFile": {
        "name": "warning_file",
        "in": "query",
        "description": "Warning audio file to play shortly before the call ends.",
        "required": false,
        "schema": {
          "type": "string"
        }
      },
      "CrmWarningRemainingSecond": {
        "name": "warning_remaining_second",
        "in": "query",
        "description": "How many seconds before the call ends the warning is played.",
        "required": false,
        "schema": {
          "type": "integer",
          "default": 0
        }
      },
      "CrmRedirectMenu": {
        "name": "redirect_menu",
        "in": "query",
        "description": "Target menu/queue/IVR name (short form; see `redirect_type` for how the full upstream name is derived).",
        "required": true,
        "schema": {
          "type": "string"
        }
      },
      "CrmRedirectType": {
        "name": "redirect_type",
        "in": "query",
        "description": "Target type. The full target name netcrm resolves against depends on it: `queue` -> `{hizmetNumarasi}-queue-{redirect_menu}`, `announcement` -> `{hizmetNumarasi}-announcement-{redirect_menu}`, `ivr` -> `{redirect_menu}-{hizmetNumarasi}`. If the resolved target or trunk does not exist on the PBX, the response has `code: \"70\"`.",
        "required": true,
        "schema": {
          "type": "string",
          "enum": [
            "queue",
            "announcement",
            "ivr"
          ]
        }
      },
      "CrmPrefix": {
        "name": "prefix",
        "in": "query",
        "description": "Call prefix. If longer than 5 characters, only its first 4 characters are used.",
        "required": false,
        "schema": {
          "type": "string",
          "maxLength": 4
        }
      },
      "CrmCallerId": {
        "name": "callerid",
        "in": "query",
        "description": "Calling number to present on the call.",
        "required": false,
        "schema": {
          "type": "string"
        }
      },
      "CrmBrandCode": {
        "name": "brandcode",
        "in": "query",
        "description": "IYS brand code. Sent together with `filter`, this triggers an IYS (İleti Yönetim Sistemi) permission check before dialing; a number without permission yields `code: \"50\"` and the call is not placed.",
        "required": false,
        "schema": {
          "type": "string"
        }
      },
      "CrmFilter": {
        "name": "filter",
        "in": "query",
        "description": "IYS recipient-type filter. Must be sent together with `brandcode` for the IYS check to run.",
        "required": false,
        "schema": {
          "type": "integer"
        }
      },
      "CrmUniqueId": {
        "name": "unique_id",
        "in": "query",
        "description": "Unique id of the call to act on.",
        "required": true,
        "schema": {
          "type": "string",
          "example": "1712345678.123"
        }
      },
      "CrmExten": {
        "name": "exten",
        "in": "query",
        "description": "Target extension.",
        "required": true,
        "schema": {
          "type": "string",
          "example": "102"
        }
      },
      "CrmMuteDirection": {
        "name": "direction",
        "in": "query",
        "description": "Audio direction to mute/unmute.",
        "required": true,
        "schema": {
          "type": "string",
          "enum": [
            "in",
            "out",
            "all"
          ]
        }
      },
      "CrmMuteState": {
        "name": "state",
        "in": "query",
        "description": "`on` mutes the audio, `off` unmutes it.",
        "required": true,
        "schema": {
          "type": "string",
          "enum": [
            "on",
            "off"
          ]
        }
      },
      "CrmDtmfDirection": {
        "name": "direction",
        "in": "query",
        "description": "`in` = towards the caller side, `out` = towards the called side.",
        "required": true,
        "schema": {
          "type": "string",
          "enum": [
            "in",
            "out"
          ]
        }
      },
      "CrmDigit": {
        "name": "digit",
        "in": "query",
        "description": "DTMF digits to send, one at a time. If sending any digit fails, the operation aborts mid-way and returns an error for that digit.",
        "required": true,
        "schema": {
          "type": "string",
          "example": "1234#"
        }
      },
      "CrmQueueOptional": {
        "name": "queue",
        "in": "query",
        "description": "Comma-separated queue name list (short form; resolved upstream as `{hizmetNumarasi}-queue-{queue}`). When omitted, all of the PBX's queues are listed.",
        "required": false,
        "schema": {
          "type": "string",
          "example": "sales,support"
        }
      },
      "CrmExtenList": {
        "name": "exten",
        "in": "query",
        "description": "Comma-separated extension list.",
        "required": true,
        "schema": {
          "type": "string",
          "example": "101,102"
        }
      },
      "CrmQueueList": {
        "name": "queue",
        "in": "query",
        "description": "Comma-separated queue name list (short form; resolved upstream as `{hizmetNumarasi}-queue-{queue}`).",
        "required": true,
        "schema": {
          "type": "string",
          "example": "sales,support"
        }
      },
      "CrmPenalty": {
        "name": "penalty",
        "in": "query",
        "description": "Priority (penalty) value within the queue.",
        "required": true,
        "schema": {
          "type": "string",
          "example": "0"
        }
      },
      "CrmPaused": {
        "name": "paused",
        "in": "query",
        "description": "`1` = paused, `0` = not paused.",
        "required": true,
        "schema": {
          "type": "string",
          "enum": [
            "0",
            "1"
          ]
        }
      },
      "CrmReason": {
        "name": "reason",
        "in": "query",
        "description": "Pause reason. Turkish characters are ASCII-folded upstream.",
        "required": true,
        "schema": {
          "type": "string",
          "example": "lunch"
        }
      },
      "CrmConferenceName": {
        "name": "conferencename",
        "in": "query",
        "description": "Conference room name.",
        "required": true,
        "schema": {
          "type": "string"
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "description": "API key issued from the portal, sent as 'Authorization: Bearer {api_key}'.",
        "bearerFormat": "API Key",
        "scheme": "bearer"
      }
    }
  },
  "tags": [
    {
      "name": "Accounts",
      "description": "Accounts"
    },
    {
      "name": "Autodialer",
      "description": "Autodialer"
    },
    {
      "name": "Breaks",
      "description": "Breaks"
    },
    {
      "name": "Call Scripts",
      "description": "Call Scripts"
    },
    {
      "name": "Contact Groups",
      "description": "Contact Groups"
    },
    {
      "name": "Contacts",
      "description": "Contacts"
    },
    {
      "name": "CRM",
      "description": "CRM"
    },
    {
      "name": "Interactions",
      "description": "Interactions"
    },
    {
      "name": "Auth",
      "description": "Auth"
    },
    {
      "name": "Projects",
      "description": "Projects"
    },
    {
      "name": "QuickReplies",
      "description": "QuickReplies"
    },
    {
      "name": "Reports",
      "description": "Reports"
    },
    {
      "name": "Tickets",
      "description": "Tickets"
    },
    {
      "name": "Trunks",
      "description": "Trunks"
    },
    {
      "name": "Users",
      "description": "Users"
    }
  ]
}