{
    "openapi": "3.1.0",
    "info": {
        "title": "TekSantral API",
        "version": "1.4.0",
        "description": "Call center integration for a TekSantral cloud PBX account: extensions and queues, queue callbacks and the callback list, call notes (disposition, tags), number routing and business hours, live agents and queues, agent log-in and breaks, transfer and listen-in, call history and recordings, click-to-call with your own reference and caller ID, hold, attended transfer and mute, voicemail, a phonebook with caller names and account owners, queue and agent reports, an event feed, OAuth for third-party apps, auto dialer campaigns, audio from text and the do-not-call list. Keys are created in the customer panel under API & integrations; every key may make 300 requests per minute."
    },
    "servers": [
        {
            "url": "https://teksantral.com/api/v1"
        }
    ],
    "security": [
        {
            "bearer": []
        },
        {
            "oauth2": [
                "read"
            ]
        }
    ],
    "components": {
        "securitySchemes": {
            "bearer": {
                "type": "http",
                "scheme": "bearer",
                "description": "API key \"tsk_…\" with the read, call, dialer and/or manage permission, or an OAuth access token \"tso_…\"."
            },
            "oauth2": {
                "type": "oauth2",
                "description": "For apps of other companies, registered by TekSantral. Authorization code with PKCE (S256) and state; access tokens last one hour, refresh tokens rotate on every use.",
                "flows": {
                    "authorizationCode": {
                        "authorizationUrl": "https://teksantral.com/oauth/authorize",
                        "tokenUrl": "https://teksantral.com/oauth/token",
                        "refreshUrl": "https://teksantral.com/oauth/token",
                        "scopes": {
                            "read": "Read calls, recordings, voicemail, phonebook, reports and live state",
                            "call": "Call control",
                            "dialer": "Auto dialer",
                            "manage": "Create and change extensions, queues and phonebook entries"
                        }
                    }
                }
            }
        },
        "responses": {
            "Error": {
                "description": "Error",
                "content": {
                    "application/json": {
                        "schema": {
                            "type": "object",
                            "properties": {
                                "error": {
                                    "type": "object",
                                    "properties": {
                                        "code": {
                                            "type": "string"
                                        },
                                        "message": {
                                            "type": "string"
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        },
        "schemas": {
            "Call": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "example": "1791900000-42",
                        "description": "Same as call_id in call.ringing and call.answered."
                    },
                    "started_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "direction": {
                        "type": "string",
                        "enum": [
                            "inbound",
                            "outbound",
                            "internal"
                        ]
                    },
                    "from": {
                        "type": "string"
                    },
                    "to": {
                        "type": "string"
                    },
                    "number_called": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "extension": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "answered_by": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "answered",
                            "missed",
                            "busy"
                        ]
                    },
                    "duration": {
                        "type": "integer"
                    },
                    "talk_time": {
                        "type": "integer"
                    },
                    "recording": {
                        "type": "boolean"
                    },
                    "source": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "click_to_call",
                            null
                        ]
                    },
                    "request_id": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Click-to-call request (POST /calls)."
                    },
                    "reference": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "description": "Your reference sent with the click-to-call."
                    },
                    "contact": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "description": "Phonebook entry of the other party, with your external_id."
                    },
                    "notes": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "description": "Disposition, tags and note (PATCH /calls/{id})."
                    },
                    "menu": {
                        "type": [
                            "array",
                            "null"
                        ],
                        "description": "Voice menu keys the caller pressed, in order (PBX agent 1.23): menu name, key (null when no key or an unused key was pressed), event (key, extension, no_key, invalid_key) and the destination name.",
                        "items": {
                            "type": "object",
                            "properties": {
                                "menu": {
                                    "type": "string"
                                },
                                "key": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "event": {
                                    "type": "string",
                                    "enum": [
                                        "key",
                                        "extension",
                                        "no_key",
                                        "invalid_key"
                                    ]
                                },
                                "destination": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                }
                            }
                        }
                    },
                    "queue": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "description": "For calls that went through a queue.",
                        "properties": {
                            "id": {
                                "type": "integer"
                            },
                            "wait": {
                                "type": "integer"
                            },
                            "result": {
                                "type": "string",
                                "enum": [
                                    "answered",
                                    "abandoned",
                                    "timeout",
                                    "exited",
                                    "waiting"
                                ]
                            },
                            "agent": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            },
                            "ended_by": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "enum": [
                                    "agent",
                                    "caller",
                                    "transfer",
                                    null
                                ]
                            },
                            "transferred_to": {
                                "type": [
                                    "string",
                                    "null"
                                ]
                            }
                        }
                    },
                    "ended_by": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "agent",
                            "caller",
                            "transfer",
                            null
                        ],
                        "description": "Known for queue calls."
                    }
                }
            },
            "Voicemail": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "string",
                        "example": "201-1792340000-0000001a"
                    },
                    "extension": {
                        "type": "string"
                    },
                    "from": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "caller_name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "received_at": {
                        "type": "string",
                        "format": "date-time"
                    },
                    "duration": {
                        "type": "integer"
                    },
                    "new": {
                        "type": "boolean"
                    }
                }
            },
            "Contact": {
                "type": "object",
                "properties": {
                    "number": {
                        "type": "string"
                    },
                    "name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "owner": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "external_id": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "updated_at": {
                        "type": "string",
                        "format": "date-time"
                    }
                }
            },
            "QueueReport": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "offered": {
                        "type": "integer"
                    },
                    "callback_requests": {
                        "type": "integer",
                        "description": "Callers who pressed 1 to be called back (not in the rates)."
                    },
                    "callbacks_connected": {
                        "type": "integer",
                        "description": "Callbacks an agent took."
                    },
                    "answered": {
                        "type": "integer"
                    },
                    "abandoned": {
                        "type": "integer"
                    },
                    "timed_out": {
                        "type": "integer"
                    },
                    "other_exits": {
                        "type": "integer"
                    },
                    "transferred": {
                        "type": "integer"
                    },
                    "answer_rate": {
                        "type": [
                            "number",
                            "null"
                        ]
                    },
                    "abandon_rate": {
                        "type": [
                            "number",
                            "null"
                        ]
                    },
                    "service_level": {
                        "type": [
                            "number",
                            "null"
                        ],
                        "description": "% of calls that ended in the queue and were answered within service_level_seconds."
                    },
                    "service_level_seconds": {
                        "type": "integer"
                    },
                    "average_wait": {
                        "type": "integer"
                    },
                    "average_abandon_wait": {
                        "type": "integer"
                    },
                    "longest_wait": {
                        "type": "integer"
                    },
                    "talk_time": {
                        "type": "integer"
                    },
                    "average_talk": {
                        "type": "integer"
                    },
                    "intervals": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "start": {
                                    "type": "string"
                                },
                                "offered": {
                                    "type": "integer"
                                },
                                "answered": {
                                    "type": "integer"
                                },
                                "abandoned": {
                                    "type": "integer"
                                }
                            }
                        }
                    }
                }
            },
            "AgentReport": {
                "type": "object",
                "properties": {
                    "extension": {
                        "type": "string"
                    },
                    "name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "calls": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "description": "From call records (all calls, queue or not).",
                        "properties": {
                            "inbound_answered": {
                                "type": "integer"
                            },
                            "outbound": {
                                "type": "integer"
                            },
                            "outbound_answered": {
                                "type": "integer"
                            },
                            "internal": {
                                "type": "integer"
                            },
                            "talk_time": {
                                "type": "integer"
                            }
                        }
                    },
                    "queue": {
                        "type": "object",
                        "properties": {
                            "answered": {
                                "type": "integer"
                            },
                            "missed": {
                                "type": "integer",
                                "description": "Queue calls that rang this agent without an answer."
                            },
                            "talk_time": {
                                "type": "integer"
                            },
                            "average_talk": {
                                "type": "integer"
                            },
                            "logged_in_time": {
                                "type": "integer",
                                "description": "Seconds logged in to log-in queues."
                            },
                            "paused_time": {
                                "type": "integer"
                            },
                            "pauses": {
                                "type": "array",
                                "items": {
                                    "type": "object",
                                    "properties": {
                                        "reason": {
                                            "type": [
                                                "string",
                                                "null"
                                            ]
                                        },
                                        "seconds": {
                                            "type": "integer"
                                        },
                                        "count": {
                                            "type": "integer"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "survey": {
                        "type": "object",
                        "description": "Post-call survey ratings (1-5) given after this agent's queue calls.",
                        "properties": {
                            "responses": {
                                "type": "integer"
                            },
                            "average": {
                                "type": [
                                    "number",
                                    "null"
                                ]
                            }
                        }
                    }
                }
            },
            "Extension": {
                "type": "object",
                "properties": {
                    "number": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "voicemail": {
                        "type": "boolean"
                    },
                    "voicemail_email": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "outbound": {
                        "type": "boolean"
                    },
                    "dnd": {
                        "type": "boolean"
                    },
                    "ring": {
                        "type": "integer"
                    },
                    "record": {
                        "type": "string"
                    },
                    "max_devices": {
                        "type": "integer"
                    },
                    "caller_id": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "forward": {
                        "type": "object"
                    },
                    "queues": {
                        "type": "array",
                        "items": {
                            "type": "integer"
                        }
                    }
                }
            },
            "Credentials": {
                "type": "object",
                "properties": {
                    "extension": {
                        "type": "string"
                    },
                    "username": {
                        "type": "string",
                        "example": "acme-201",
                        "description": "SIP user name and auth ID. With a user name prefix set on the extension in the panel this is \"{prefix}-{extension}\", otherwise \"t{account}-{extension}\"."
                    },
                    "legacy_username": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "example": "t12-201",
                        "description": "The built-in user name, which keeps working with the same password while a prefix is set; null when username is already the built-in one."
                    },
                    "password": {
                        "type": "string"
                    },
                    "server": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "port": {
                        "type": "integer"
                    },
                    "transports": {
                        "type": "array",
                        "items": {
                            "type": "string"
                        }
                    },
                    "webrtc": {
                        "type": [
                            "object",
                            "null"
                        ],
                        "description": "Browser phone (SIP over WSS, e.g. JsSIP or SIP.js) when enabled for the account.",
                        "properties": {
                            "url": {
                                "type": "string"
                            },
                            "domain": {
                                "type": "string"
                            },
                            "username": {
                                "type": "string"
                            },
                            "password": {
                                "type": "string"
                            }
                        }
                    }
                }
            },
            "Queue": {
                "allOf": [
                    {
                        "type": "object",
                        "properties": {
                            "name": {
                                "type": "string",
                                "maxLength": 60
                            },
                            "number": {
                                "type": [
                                    "string",
                                    "null"
                                ],
                                "description": "Optional internal dial number."
                            },
                            "strategy": {
                                "type": "string",
                                "enum": [
                                    "ringall",
                                    "leastrecent",
                                    "fewestcalls",
                                    "rrmemory",
                                    "linear",
                                    "random"
                                ]
                            },
                            "login_required": {
                                "type": "boolean",
                                "description": "Agents log in and out (phones: *45 / *46, or the API). With an empty agent list every extension may log in."
                            },
                            "agents": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                },
                                "maxItems": 100
                            },
                            "ring": {
                                "type": "integer",
                                "minimum": 5,
                                "maximum": 120
                            },
                            "retry": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 60
                            },
                            "wrapup": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 600
                            },
                            "max_wait": {
                                "type": "integer",
                                "minimum": 10,
                                "maximum": 7200
                            },
                            "join_sound_id": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            },
                            "periodic_sound_id": {
                                "type": [
                                    "integer",
                                    "null"
                                ]
                            },
                            "periodic_every": {
                                "type": "integer",
                                "minimum": 15,
                                "maximum": 3600
                            },
                            "timeout_destination": {
                                "type": "string",
                                "example": "voicemail:201",
                                "description": "\"extension:N\", \"voicemail:N\", \"queue:ID\", \"ringgroup:ID\", \"ivr:ID\", \"announcement:ID\", \"schedule:ID\", \"external:+90…\" or \"hangup\"."
                            },
                            "owner_first": {
                                "type": "boolean",
                                "description": "A caller whose phonebook entry has an owner rings that extension first when it is free (and, in a log-in queue, logged in and not on a break); otherwise or unanswered the call joins the queue."
                            },
                            "owner_ring": {
                                "type": "integer",
                                "minimum": 5,
                                "maximum": 60,
                                "default": 15,
                                "description": "Seconds the owner rings before the call joins the queue."
                            },
                            "callback": {
                                "type": "boolean",
                                "description": "Callers may press 1 to hang up and keep their place; when their turn comes the free agent is connected and the customer called. Needs callback_sound_id."
                            },
                            "callback_sound_id": {
                                "type": [
                                    "integer",
                                    "null"
                                ],
                                "description": "Prompt played with the periodic announcements, e.g. \"Press 1 to keep your place and be called back\"."
                            },
                            "callback_confirm_sound_id": {
                                "type": [
                                    "integer",
                                    "null"
                                ],
                                "description": "Played after the key press (a beep without one)."
                            },
                            "callback_wait": {
                                "type": "integer",
                                "minimum": 300,
                                "maximum": 28800,
                                "default": 3600,
                                "description": "Seconds a callback keeps its place before it goes to the callback list."
                            },
                            "missed_callback": {
                                "type": "string",
                                "enum": [
                                    "off",
                                    "list",
                                    "auto"
                                ],
                                "description": "Callers who hang up after 5 s or whose wait runs out: nothing, the callback list, or straight back into the queue as a callback."
                            },
                            "alerts": {
                                "type": "object",
                                "description": "Supervisor alert limits (0 or false is off), sent to the recipients set on the wallboard page and as queue.alert webhooks.",
                                "properties": {
                                    "wait": {
                                        "type": "integer",
                                        "description": "Longest wait in seconds."
                                    },
                                    "waiting": {
                                        "type": "integer",
                                        "description": "Callers waiting at once."
                                    },
                                    "abandon_rate": {
                                        "type": "integer",
                                        "description": "Percent abandoned in the last hour (at least 5 calls)."
                                    },
                                    "service_level": {
                                        "type": "integer",
                                        "description": "Alert below this percent answered within 20 s in the last hour."
                                    },
                                    "no_agent": {
                                        "type": "boolean",
                                        "description": "Callers wait and no agent is free or on a call."
                                    },
                                    "callbacks": {
                                        "type": "integer",
                                        "description": "Customers on the callback list waiting to be called."
                                    }
                                }
                            },
                            "callback_retries": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 3,
                                "default": 1,
                                "description": "Times a busy or unanswered customer is queued again."
                            },
                            "callback_retry_delay": {
                                "type": "integer",
                                "minimum": 1,
                                "maximum": 120,
                                "default": 10,
                                "description": "Minutes between those tries."
                            },
                            "survey": {
                                "type": "boolean",
                                "description": "Post-call survey (PBX agent 1.19): after the agent hangs up the caller rates the call with a key 1-5. Needs survey_sound_id."
                            },
                            "survey_sound_id": {
                                "type": [
                                    "integer",
                                    "null"
                                ],
                                "description": "The question callers hear."
                            },
                            "survey_thanks_sound_id": {
                                "type": [
                                    "integer",
                                    "null"
                                ],
                                "description": "Plays after the rating."
                            }
                        }
                    },
                    {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "integer"
                            }
                        }
                    }
                ]
            },
            "Agent": {
                "type": "object",
                "properties": {
                    "extension": {
                        "type": "string"
                    },
                    "name": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "available",
                            "on_call",
                            "ringing",
                            "on_hold",
                            "paused",
                            "dnd",
                            "offline"
                        ]
                    },
                    "device": {
                        "type": "string",
                        "enum": [
                            "idle",
                            "ringing",
                            "on_call",
                            "on_hold",
                            "offline"
                        ]
                    },
                    "registered": {
                        "type": "boolean"
                    },
                    "dnd": {
                        "type": "boolean"
                    },
                    "logged_in": {
                        "type": "boolean"
                    },
                    "paused": {
                        "type": "boolean"
                    },
                    "pause_reason": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "queues": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "id": {
                                    "type": "integer"
                                },
                                "name": {
                                    "type": "string"
                                },
                                "paused": {
                                    "type": "boolean"
                                },
                                "pause_reason": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "calls_taken": {
                                    "type": "integer"
                                },
                                "last_call_at": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                }
                            }
                        }
                    }
                }
            },
            "QueueLive": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "waiting": {
                        "type": "integer"
                    },
                    "longest_wait": {
                        "type": "integer"
                    },
                    "callers": {
                        "type": "array",
                        "items": {
                            "type": "object",
                            "properties": {
                                "position": {
                                    "type": "integer"
                                },
                                "from": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                },
                                "wait": {
                                    "type": "integer"
                                },
                                "channel_id": {
                                    "type": [
                                        "string",
                                        "null"
                                    ]
                                }
                            }
                        }
                    },
                    "agents": {
                        "type": "object",
                        "properties": {
                            "logged_in": {
                                "type": "integer"
                            },
                            "available": {
                                "type": "integer"
                            },
                            "on_call": {
                                "type": "integer"
                            },
                            "paused": {
                                "type": "integer"
                            }
                        }
                    },
                    "members": {
                        "type": "array",
                        "items": {
                            "type": "object"
                        }
                    },
                    "stats": {
                        "type": "object",
                        "description": "Since the PBX last reset queue statistics (restart).",
                        "properties": {
                            "completed": {
                                "type": "integer"
                            },
                            "abandoned": {
                                "type": "integer"
                            },
                            "average_wait": {
                                "type": "integer"
                            },
                            "average_talk": {
                                "type": "integer"
                            },
                            "service_level": {
                                "type": [
                                    "number",
                                    "null"
                                ]
                            }
                        }
                    }
                }
            },
            "LiveCall": {
                "type": "object",
                "properties": {
                    "call_id": {
                        "type": "string",
                        "description": "Shared by every leg of the call; the id of its call record afterwards."
                    },
                    "channel_id": {
                        "type": "string",
                        "description": "This leg; used for transfer and hang-up."
                    },
                    "extension": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "device": {
                        "type": [
                            "string",
                            "null"
                        ],
                        "enum": [
                            "phone",
                            "browser",
                            null
                        ]
                    },
                    "state": {
                        "type": "string",
                        "enum": [
                            "ringing",
                            "talking",
                            "waiting",
                            "up",
                            "dialing",
                            "on_hold",
                            "holding",
                            "consulting"
                        ]
                    },
                    "number": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "dialled": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "queue_id": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "duration": {
                        "type": "integer"
                    }
                }
            },
            "Campaign": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "mode": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "paused",
                            "running",
                            "done",
                            "cancelled"
                        ]
                    },
                    "caller_id": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "start_at": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "stats": {
                        "type": "object",
                        "additionalProperties": {
                            "type": "integer"
                        }
                    }
                }
            },
            "SpokenSound": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "name": {
                        "type": "string"
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "ready",
                            "pending"
                        ]
                    },
                    "seconds": {
                        "type": [
                            "integer",
                            "null"
                        ]
                    },
                    "characters": {
                        "type": "integer"
                    },
                    "from_text": {
                        "type": "boolean"
                    }
                }
            },
            "CampaignNumber": {
                "type": "object",
                "properties": {
                    "id": {
                        "type": "integer"
                    },
                    "number": {
                        "type": "string"
                    },
                    "name": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "status": {
                        "type": "string",
                        "enum": [
                            "pending",
                            "dialing",
                            "answered",
                            "press1",
                            "optout",
                            "busy",
                            "noanswer",
                            "failed",
                            "dnc",
                            "cancelled"
                        ]
                    },
                    "last_result": {
                        "type": [
                            "string",
                            "null"
                        ]
                    },
                    "attempts": {
                        "type": "integer"
                    }
                }
            }
        }
    },
    "paths": {
        "/me": {
            "get": {
                "summary": "Account and key permissions",
                "responses": {
                    "200": {
                        "description": "Account",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/extensions": {
            "get": {
                "summary": "Extensions (read)",
                "responses": {
                    "200": {
                        "description": "Extensions",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Extension"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "post": {
                "summary": "Create an extension, or up to 100 with {\"extensions\":[…]} (all or nothing); the answer carries SIP credentials (manage)",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "oneOf": [
                                    {
                                        "allOf": [
                                            {
                                                "type": "object",
                                                "properties": {
                                                    "number": {
                                                        "type": "string",
                                                        "example": "201"
                                                    },
                                                    "name": {
                                                        "type": "string",
                                                        "maxLength": 60,
                                                        "example": "Ayşe Yılmaz"
                                                    },
                                                    "voicemail": {
                                                        "type": "boolean"
                                                    },
                                                    "voicemail_email": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "voicemail_pin": {
                                                        "type": "string",
                                                        "description": "4-8 digits; made at random when voicemail is switched on without one."
                                                    },
                                                    "outbound": {
                                                        "type": "boolean",
                                                        "default": true
                                                    },
                                                    "dnd": {
                                                        "type": "boolean"
                                                    },
                                                    "ring": {
                                                        "type": "integer",
                                                        "minimum": 5,
                                                        "maximum": 180,
                                                        "default": 25
                                                    },
                                                    "record": {
                                                        "type": "string",
                                                        "enum": [
                                                            "default",
                                                            "always",
                                                            "never"
                                                        ]
                                                    },
                                                    "max_devices": {
                                                        "type": "integer",
                                                        "minimum": 1,
                                                        "maximum": 10,
                                                        "default": 3
                                                    },
                                                    "caller_id": {
                                                        "oneOf": [
                                                            {
                                                                "type": "string"
                                                            },
                                                            {
                                                                "type": "integer"
                                                            },
                                                            {
                                                                "type": "null"
                                                            }
                                                        ],
                                                        "description": "One of your active numbers (E.164 or id from GET /numbers) shown on outbound calls."
                                                    },
                                                    "forward": {
                                                        "type": "object",
                                                        "properties": {
                                                            "always": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "busy": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            },
                                                            "no_answer": {
                                                                "type": [
                                                                    "string",
                                                                    "null"
                                                                ]
                                                            }
                                                        }
                                                    }
                                                }
                                            },
                                            {
                                                "required": [
                                                    "number",
                                                    "name"
                                                ]
                                            }
                                        ]
                                    },
                                    {
                                        "type": "object",
                                        "required": [
                                            "extensions"
                                        ],
                                        "properties": {
                                            "extensions": {
                                                "type": "array",
                                                "maxItems": 100,
                                                "items": {
                                                    "type": "object",
                                                    "properties": {
                                                        "number": {
                                                            "type": "string",
                                                            "example": "201"
                                                        },
                                                        "name": {
                                                            "type": "string",
                                                            "maxLength": 60,
                                                            "example": "Ayşe Yılmaz"
                                                        },
                                                        "voicemail": {
                                                            "type": "boolean"
                                                        },
                                                        "voicemail_email": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ]
                                                        },
                                                        "voicemail_pin": {
                                                            "type": "string",
                                                            "description": "4-8 digits; made at random when voicemail is switched on without one."
                                                        },
                                                        "outbound": {
                                                            "type": "boolean",
                                                            "default": true
                                                        },
                                                        "dnd": {
                                                            "type": "boolean"
                                                        },
                                                        "ring": {
                                                            "type": "integer",
                                                            "minimum": 5,
                                                            "maximum": 180,
                                                            "default": 25
                                                        },
                                                        "record": {
                                                            "type": "string",
                                                            "enum": [
                                                                "default",
                                                                "always",
                                                                "never"
                                                            ]
                                                        },
                                                        "max_devices": {
                                                            "type": "integer",
                                                            "minimum": 1,
                                                            "maximum": 10,
                                                            "default": 3
                                                        },
                                                        "caller_id": {
                                                            "oneOf": [
                                                                {
                                                                    "type": "string"
                                                                },
                                                                {
                                                                    "type": "integer"
                                                                },
                                                                {
                                                                    "type": "null"
                                                                }
                                                            ],
                                                            "description": "One of your active numbers (E.164 or id from GET /numbers) shown on outbound calls."
                                                        },
                                                        "forward": {
                                                            "type": "object",
                                                            "properties": {
                                                                "always": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "busy": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                },
                                                                "no_answer": {
                                                                    "type": [
                                                                        "string",
                                                                        "null"
                                                                    ]
                                                                }
                                                            }
                                                        }
                                                    }
                                                }
                                            }
                                        }
                                    }
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "allOf": [
                                                {
                                                    "$ref": "#/components/schemas/Extension"
                                                },
                                                {
                                                    "type": "object",
                                                    "properties": {
                                                        "credentials": {
                                                            "$ref": "#/components/schemas/Credentials"
                                                        }
                                                    }
                                                }
                                            ]
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "pbx": {
                                                    "type": "string",
                                                    "enum": [
                                                        "applied",
                                                        "queued",
                                                        "service_inactive"
                                                    ],
                                                    "description": "applied: live now; queued: reaches the PBX within about a minute."
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/extensions/{number}": {
            "get": {
                "summary": "Extension (read)",
                "parameters": [
                    {
                        "name": "number",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "201"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Extension",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Extension"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/Error"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "patch": {
                "summary": "Change the fields you send (manage)",
                "parameters": [
                    {
                        "name": "number",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "201"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "number": {
                                        "type": "string",
                                        "example": "201"
                                    },
                                    "name": {
                                        "type": "string",
                                        "maxLength": 60,
                                        "example": "Ayşe Yılmaz"
                                    },
                                    "voicemail": {
                                        "type": "boolean"
                                    },
                                    "voicemail_email": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "voicemail_pin": {
                                        "type": "string",
                                        "description": "4-8 digits; made at random when voicemail is switched on without one."
                                    },
                                    "outbound": {
                                        "type": "boolean",
                                        "default": true
                                    },
                                    "dnd": {
                                        "type": "boolean"
                                    },
                                    "ring": {
                                        "type": "integer",
                                        "minimum": 5,
                                        "maximum": 180,
                                        "default": 25
                                    },
                                    "record": {
                                        "type": "string",
                                        "enum": [
                                            "default",
                                            "always",
                                            "never"
                                        ]
                                    },
                                    "max_devices": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 10,
                                        "default": 3
                                    },
                                    "caller_id": {
                                        "oneOf": [
                                            {
                                                "type": "string"
                                            },
                                            {
                                                "type": "integer"
                                            },
                                            {
                                                "type": "null"
                                            }
                                        ],
                                        "description": "One of your active numbers (E.164 or id from GET /numbers) shown on outbound calls."
                                    },
                                    "forward": {
                                        "type": "object",
                                        "properties": {
                                            "always": {
                                                "type": [
                                                    "string",
                                                    "null"
                                                ]
                                            },
                                            "busy": {
                                                "type": [
                                                    "string",
                                                    "null"
                                                ]
                                            },
                                            "no_answer": {
                                                "type": [
                                                    "string",
                                                    "null"
                                                ]
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Extension",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Extension"
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "pbx": {
                                                    "type": "string",
                                                    "enum": [
                                                        "applied",
                                                        "queued",
                                                        "service_inactive"
                                                    ],
                                                    "description": "applied: live now; queued: reaches the PBX within about a minute."
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "delete": {
                "summary": "Delete; refused (409) while a queue or route uses it (manage)",
                "parameters": [
                    {
                        "name": "number",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "201"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "pbx": {
                                                    "type": "string",
                                                    "enum": [
                                                        "applied",
                                                        "queued",
                                                        "service_inactive"
                                                    ],
                                                    "description": "applied: live now; queued: reaches the PBX within about a minute."
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "409": {
                        "$ref": "#/components/responses/Error"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/extensions/{number}/credentials": {
            "get": {
                "summary": "SIP and browser phone credentials (manage)",
                "parameters": [
                    {
                        "name": "number",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "201"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Credentials",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Credentials"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/extensions/{number}/credentials/reset": {
            "post": {
                "summary": "New SIP and browser phone passwords; devices using the old ones disconnect (manage)",
                "parameters": [
                    {
                        "name": "number",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "201"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Credentials",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Credentials"
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "pbx": {
                                                    "type": "string",
                                                    "enum": [
                                                        "applied",
                                                        "queued",
                                                        "service_inactive"
                                                    ],
                                                    "description": "applied: live now; queued: reaches the PBX within about a minute."
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/queues": {
            "get": {
                "summary": "Call queues (read)",
                "responses": {
                    "200": {
                        "description": "Queues",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Queue"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "post": {
                "summary": "Create a queue (manage)",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "allOf": [
                                    {
                                        "type": "object",
                                        "properties": {
                                            "name": {
                                                "type": "string",
                                                "maxLength": 60
                                            },
                                            "number": {
                                                "type": [
                                                    "string",
                                                    "null"
                                                ],
                                                "description": "Optional internal dial number."
                                            },
                                            "strategy": {
                                                "type": "string",
                                                "enum": [
                                                    "ringall",
                                                    "leastrecent",
                                                    "fewestcalls",
                                                    "rrmemory",
                                                    "linear",
                                                    "random"
                                                ]
                                            },
                                            "login_required": {
                                                "type": "boolean",
                                                "description": "Agents log in and out (phones: *45 / *46, or the API). With an empty agent list every extension may log in."
                                            },
                                            "agents": {
                                                "type": "array",
                                                "items": {
                                                    "type": "string"
                                                },
                                                "maxItems": 100
                                            },
                                            "ring": {
                                                "type": "integer",
                                                "minimum": 5,
                                                "maximum": 120
                                            },
                                            "retry": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 60
                                            },
                                            "wrapup": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 600
                                            },
                                            "max_wait": {
                                                "type": "integer",
                                                "minimum": 10,
                                                "maximum": 7200
                                            },
                                            "join_sound_id": {
                                                "type": [
                                                    "integer",
                                                    "null"
                                                ]
                                            },
                                            "periodic_sound_id": {
                                                "type": [
                                                    "integer",
                                                    "null"
                                                ]
                                            },
                                            "periodic_every": {
                                                "type": "integer",
                                                "minimum": 15,
                                                "maximum": 3600
                                            },
                                            "timeout_destination": {
                                                "type": "string",
                                                "example": "voicemail:201",
                                                "description": "\"extension:N\", \"voicemail:N\", \"queue:ID\", \"ringgroup:ID\", \"ivr:ID\", \"announcement:ID\", \"schedule:ID\", \"external:+90…\" or \"hangup\"."
                                            },
                                            "owner_first": {
                                                "type": "boolean",
                                                "description": "A caller whose phonebook entry has an owner rings that extension first when it is free (and, in a log-in queue, logged in and not on a break); otherwise or unanswered the call joins the queue."
                                            },
                                            "owner_ring": {
                                                "type": "integer",
                                                "minimum": 5,
                                                "maximum": 60,
                                                "default": 15,
                                                "description": "Seconds the owner rings before the call joins the queue."
                                            },
                                            "callback": {
                                                "type": "boolean",
                                                "description": "Callers may press 1 to hang up and keep their place; when their turn comes the free agent is connected and the customer called. Needs callback_sound_id."
                                            },
                                            "callback_sound_id": {
                                                "type": [
                                                    "integer",
                                                    "null"
                                                ],
                                                "description": "Prompt played with the periodic announcements, e.g. \"Press 1 to keep your place and be called back\"."
                                            },
                                            "callback_confirm_sound_id": {
                                                "type": [
                                                    "integer",
                                                    "null"
                                                ],
                                                "description": "Played after the key press (a beep without one)."
                                            },
                                            "callback_wait": {
                                                "type": "integer",
                                                "minimum": 300,
                                                "maximum": 28800,
                                                "default": 3600,
                                                "description": "Seconds a callback keeps its place before it goes to the callback list."
                                            },
                                            "missed_callback": {
                                                "type": "string",
                                                "enum": [
                                                    "off",
                                                    "list",
                                                    "auto"
                                                ],
                                                "description": "Callers who hang up after 5 s or whose wait runs out: nothing, the callback list, or straight back into the queue as a callback."
                                            },
                                            "alerts": {
                                                "type": "object",
                                                "description": "Supervisor alert limits (0 or false is off), sent to the recipients set on the wallboard page and as queue.alert webhooks.",
                                                "properties": {
                                                    "wait": {
                                                        "type": "integer",
                                                        "description": "Longest wait in seconds."
                                                    },
                                                    "waiting": {
                                                        "type": "integer",
                                                        "description": "Callers waiting at once."
                                                    },
                                                    "abandon_rate": {
                                                        "type": "integer",
                                                        "description": "Percent abandoned in the last hour (at least 5 calls)."
                                                    },
                                                    "service_level": {
                                                        "type": "integer",
                                                        "description": "Alert below this percent answered within 20 s in the last hour."
                                                    },
                                                    "no_agent": {
                                                        "type": "boolean",
                                                        "description": "Callers wait and no agent is free or on a call."
                                                    },
                                                    "callbacks": {
                                                        "type": "integer",
                                                        "description": "Customers on the callback list waiting to be called."
                                                    }
                                                }
                                            },
                                            "callback_retries": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 3,
                                                "default": 1,
                                                "description": "Times a busy or unanswered customer is queued again."
                                            },
                                            "callback_retry_delay": {
                                                "type": "integer",
                                                "minimum": 1,
                                                "maximum": 120,
                                                "default": 10,
                                                "description": "Minutes between those tries."
                                            },
                                            "survey": {
                                                "type": "boolean",
                                                "description": "Post-call survey (PBX agent 1.19): after the agent hangs up the caller rates the call with a key 1-5. Needs survey_sound_id."
                                            },
                                            "survey_sound_id": {
                                                "type": [
                                                    "integer",
                                                    "null"
                                                ],
                                                "description": "The question callers hear."
                                            },
                                            "survey_thanks_sound_id": {
                                                "type": [
                                                    "integer",
                                                    "null"
                                                ],
                                                "description": "Plays after the rating."
                                            }
                                        }
                                    },
                                    {
                                        "required": [
                                            "name"
                                        ]
                                    }
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Queue"
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "pbx": {
                                                    "type": "string",
                                                    "enum": [
                                                        "applied",
                                                        "queued",
                                                        "service_inactive"
                                                    ],
                                                    "description": "applied: live now; queued: reaches the PBX within about a minute."
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/queues/{id}": {
            "get": {
                "summary": "Queue (read)",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Queue",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Queue"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "patch": {
                "summary": "Change the fields you send (manage)",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "maxLength": 60
                                    },
                                    "number": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Optional internal dial number."
                                    },
                                    "strategy": {
                                        "type": "string",
                                        "enum": [
                                            "ringall",
                                            "leastrecent",
                                            "fewestcalls",
                                            "rrmemory",
                                            "linear",
                                            "random"
                                        ]
                                    },
                                    "login_required": {
                                        "type": "boolean",
                                        "description": "Agents log in and out (phones: *45 / *46, or the API). With an empty agent list every extension may log in."
                                    },
                                    "agents": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        },
                                        "maxItems": 100
                                    },
                                    "ring": {
                                        "type": "integer",
                                        "minimum": 5,
                                        "maximum": 120
                                    },
                                    "retry": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 60
                                    },
                                    "wrapup": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 600
                                    },
                                    "max_wait": {
                                        "type": "integer",
                                        "minimum": 10,
                                        "maximum": 7200
                                    },
                                    "join_sound_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    },
                                    "periodic_sound_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ]
                                    },
                                    "periodic_every": {
                                        "type": "integer",
                                        "minimum": 15,
                                        "maximum": 3600
                                    },
                                    "timeout_destination": {
                                        "type": "string",
                                        "example": "voicemail:201",
                                        "description": "\"extension:N\", \"voicemail:N\", \"queue:ID\", \"ringgroup:ID\", \"ivr:ID\", \"announcement:ID\", \"schedule:ID\", \"external:+90…\" or \"hangup\"."
                                    },
                                    "owner_first": {
                                        "type": "boolean",
                                        "description": "A caller whose phonebook entry has an owner rings that extension first when it is free (and, in a log-in queue, logged in and not on a break); otherwise or unanswered the call joins the queue."
                                    },
                                    "owner_ring": {
                                        "type": "integer",
                                        "minimum": 5,
                                        "maximum": 60,
                                        "default": 15,
                                        "description": "Seconds the owner rings before the call joins the queue."
                                    },
                                    "callback": {
                                        "type": "boolean",
                                        "description": "Callers may press 1 to hang up and keep their place; when their turn comes the free agent is connected and the customer called. Needs callback_sound_id."
                                    },
                                    "callback_sound_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "description": "Prompt played with the periodic announcements, e.g. \"Press 1 to keep your place and be called back\"."
                                    },
                                    "callback_confirm_sound_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "description": "Played after the key press (a beep without one)."
                                    },
                                    "callback_wait": {
                                        "type": "integer",
                                        "minimum": 300,
                                        "maximum": 28800,
                                        "default": 3600,
                                        "description": "Seconds a callback keeps its place before it goes to the callback list."
                                    },
                                    "missed_callback": {
                                        "type": "string",
                                        "enum": [
                                            "off",
                                            "list",
                                            "auto"
                                        ],
                                        "description": "Callers who hang up after 5 s or whose wait runs out: nothing, the callback list, or straight back into the queue as a callback."
                                    },
                                    "alerts": {
                                        "type": "object",
                                        "description": "Supervisor alert limits (0 or false is off), sent to the recipients set on the wallboard page and as queue.alert webhooks.",
                                        "properties": {
                                            "wait": {
                                                "type": "integer",
                                                "description": "Longest wait in seconds."
                                            },
                                            "waiting": {
                                                "type": "integer",
                                                "description": "Callers waiting at once."
                                            },
                                            "abandon_rate": {
                                                "type": "integer",
                                                "description": "Percent abandoned in the last hour (at least 5 calls)."
                                            },
                                            "service_level": {
                                                "type": "integer",
                                                "description": "Alert below this percent answered within 20 s in the last hour."
                                            },
                                            "no_agent": {
                                                "type": "boolean",
                                                "description": "Callers wait and no agent is free or on a call."
                                            },
                                            "callbacks": {
                                                "type": "integer",
                                                "description": "Customers on the callback list waiting to be called."
                                            }
                                        }
                                    },
                                    "callback_retries": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 3,
                                        "default": 1,
                                        "description": "Times a busy or unanswered customer is queued again."
                                    },
                                    "callback_retry_delay": {
                                        "type": "integer",
                                        "minimum": 1,
                                        "maximum": 120,
                                        "default": 10,
                                        "description": "Minutes between those tries."
                                    },
                                    "survey": {
                                        "type": "boolean",
                                        "description": "Post-call survey (PBX agent 1.19): after the agent hangs up the caller rates the call with a key 1-5. Needs survey_sound_id."
                                    },
                                    "survey_sound_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "description": "The question callers hear."
                                    },
                                    "survey_thanks_sound_id": {
                                        "type": [
                                            "integer",
                                            "null"
                                        ],
                                        "description": "Plays after the rating."
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Queue",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Queue"
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "pbx": {
                                                    "type": "string",
                                                    "enum": [
                                                        "applied",
                                                        "queued",
                                                        "service_inactive"
                                                    ],
                                                    "description": "applied: live now; queued: reaches the PBX within about a minute."
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "delete": {
                "summary": "Delete; refused (409) while a number or menu routes to it (manage)",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "pbx": {
                                                    "type": "string",
                                                    "enum": [
                                                        "applied",
                                                        "queued",
                                                        "service_inactive"
                                                    ],
                                                    "description": "applied: live now; queued: reaches the PBX within about a minute."
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "409": {
                        "$ref": "#/components/responses/Error"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/queues/{id}/agents": {
            "put": {
                "summary": "Replace the agent list (manage)",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "agents"
                                ],
                                "properties": {
                                    "agents": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Queue",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Queue"
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "pbx": {
                                                    "type": "string",
                                                    "enum": [
                                                        "applied",
                                                        "queued",
                                                        "service_inactive"
                                                    ],
                                                    "description": "applied: live now; queued: reaches the PBX within about a minute."
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "post": {
                "summary": "Add agents (manage)",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "agents"
                                ],
                                "properties": {
                                    "agents": {
                                        "type": "array",
                                        "items": {
                                            "type": "string"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Queue",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Queue"
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "pbx": {
                                                    "type": "string",
                                                    "enum": [
                                                        "applied",
                                                        "queued",
                                                        "service_inactive"
                                                    ],
                                                    "description": "applied: live now; queued: reaches the PBX within about a minute."
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/queues/{id}/agents/{number}": {
            "delete": {
                "summary": "Remove an agent (manage)",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "number",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "201"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Queue",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Queue"
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "pbx": {
                                                    "type": "string",
                                                    "enum": [
                                                        "applied",
                                                        "queued",
                                                        "service_inactive"
                                                    ],
                                                    "description": "applied: live now; queued: reaches the PBX within about a minute."
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/queues/live": {
            "get": {
                "summary": "Wallboard of every queue (read)",
                "responses": {
                    "200": {
                        "description": "Queues",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/QueueLive"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "503": {
                        "$ref": "#/components/responses/Error"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/queues/{id}/live": {
            "get": {
                "summary": "Wallboard of one queue (read)",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Queue",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/QueueLive"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "503": {
                        "$ref": "#/components/responses/Error"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/agents": {
            "get": {
                "summary": "Live state of every agent (read)",
                "responses": {
                    "200": {
                        "description": "Agents",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Agent"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "503": {
                        "$ref": "#/components/responses/Error"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/agents/{number}": {
            "get": {
                "summary": "Live state of one agent (read)",
                "parameters": [
                    {
                        "name": "number",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "201"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Agent",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Agent"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "503": {
                        "$ref": "#/components/responses/Error"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/agents/{number}/login": {
            "post": {
                "summary": "Log in to queues that require log-in (call)",
                "parameters": [
                    {
                        "name": "number",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "201"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "queues": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        },
                                        "description": "Default: every eligible queue."
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Agent state afterwards",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Agent"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "409": {
                        "$ref": "#/components/responses/Error"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/agents/{number}/logout": {
            "post": {
                "summary": "Log out of queues that require log-in (call)",
                "parameters": [
                    {
                        "name": "number",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "201"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "queues": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Agent state afterwards",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Agent"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "409": {
                        "$ref": "#/components/responses/Error"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/agents/{number}/pause": {
            "post": {
                "summary": "Start a break; queue calls skip the agent (call)",
                "parameters": [
                    {
                        "name": "number",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "201"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "reason": {
                                        "type": "string",
                                        "pattern": "^[a-z0-9_-]{1,20}$",
                                        "example": "lunch"
                                    },
                                    "queues": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Agent state afterwards",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Agent"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "409": {
                        "$ref": "#/components/responses/Error"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/agents/{number}/unpause": {
            "post": {
                "summary": "End a break (call)",
                "parameters": [
                    {
                        "name": "number",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "201"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "queues": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer"
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Agent state afterwards",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Agent"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "409": {
                        "$ref": "#/components/responses/Error"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/agents/{number}/listen": {
            "post": {
                "summary": "Supervisor listen-in: the supervisor's phone rings, then joins the agent's call (call)",
                "parameters": [
                    {
                        "name": "number",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "201"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "supervisor"
                                ],
                                "properties": {
                                    "supervisor": {
                                        "type": "string",
                                        "example": "200"
                                    },
                                    "mode": {
                                        "type": "string",
                                        "enum": [
                                            "listen",
                                            "whisper",
                                            "barge"
                                        ],
                                        "default": "listen"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "202": {
                        "description": "Ringing the supervisor",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "503": {
                        "$ref": "#/components/responses/Error"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/calls/live": {
            "get": {
                "summary": "Calls in progress (read)",
                "responses": {
                    "200": {
                        "description": "Calls",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/LiveCall"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "503": {
                        "$ref": "#/components/responses/Error"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/calls/live/{channel_id}/transfer": {
            "post": {
                "summary": "Transfer the other party to an extension, queue or ring group number, or an outside number (call). mode=blind moves them at once; mode=attended (agent 1.12) holds them while the agent talks to the target, then /transfer/complete or /transfer/cancel",
                "parameters": [
                    {
                        "name": "channel_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "1791900000-45"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "to"
                                ],
                                "properties": {
                                    "to": {
                                        "type": "string",
                                        "example": "202"
                                    },
                                    "mode": {
                                        "type": "string",
                                        "enum": [
                                            "blind",
                                            "attended"
                                        ],
                                        "default": "blind"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Transferred or consulting",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/Error"
                    },
                    "422": {
                        "$ref": "#/components/responses/Error"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/calls/live/{channel_id}/transfer/complete": {
            "post": {
                "summary": "Attended transfer: connect the held party to the target; the agent drops out (call, agent 1.12)",
                "parameters": [
                    {
                        "name": "channel_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "1791900000-45"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Transferred",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/Error"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/calls/live/{channel_id}/transfer/cancel": {
            "post": {
                "summary": "Attended transfer: end the consultation and return to the held party (call, agent 1.12)",
                "parameters": [
                    {
                        "name": "channel_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "1791900000-45"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Resumed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/calls/live/{channel_id}/hold": {
            "post": {
                "summary": "Hold: the other party hears hold music; channel_id is the agent's leg (call, agent 1.12)",
                "parameters": [
                    {
                        "name": "channel_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "1791900000-45"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "On hold",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "$ref": "#/components/responses/Error"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/calls/live/{channel_id}/unhold": {
            "post": {
                "summary": "Resume a held call (call, agent 1.12)",
                "parameters": [
                    {
                        "name": "channel_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "1791900000-45"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Resumed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/calls/live/{channel_id}/mute": {
            "post": {
                "summary": "Mute the agent: the other party no longer hears them (call, agent 1.12)",
                "parameters": [
                    {
                        "name": "channel_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "1791900000-45"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Muted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/calls/live/{channel_id}/unmute": {
            "post": {
                "summary": "Unmute the agent (call, agent 1.12)",
                "parameters": [
                    {
                        "name": "channel_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "1791900000-45"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Unmuted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/calls/live/{channel_id}/hangup": {
            "post": {
                "summary": "Hang up a call (call)",
                "parameters": [
                    {
                        "name": "channel_id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Hung up",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/Error"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/numbers": {
            "get": {
                "summary": "Your numbers with where their calls go (read)",
                "responses": {
                    "200": {
                        "description": "Numbers",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "number": {
                                                        "type": "string"
                                                    },
                                                    "name": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "status": {
                                                        "type": "string",
                                                        "enum": [
                                                            "active",
                                                            "pending"
                                                        ]
                                                    },
                                                    "destination": {
                                                        "type": "string",
                                                        "example": "ivr:1"
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/numbers/{id}": {
            "get": {
                "summary": "One number (read)",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Number",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "number": {
                                                    "type": "string"
                                                },
                                                "name": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "status": {
                                                    "type": "string",
                                                    "enum": [
                                                        "active",
                                                        "pending"
                                                    ]
                                                },
                                                "destination": {
                                                    "type": "string",
                                                    "example": "ivr:1"
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "patch": {
                "summary": "Change where a number's calls go, or its label (manage)",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "destination": {
                                        "type": "string",
                                        "example": "queue:3",
                                        "description": "As in GET /destinations, or \"external:+90…\"."
                                    },
                                    "name": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Number",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "number": {
                                                    "type": "string"
                                                },
                                                "name": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "status": {
                                                    "type": "string",
                                                    "enum": [
                                                        "active",
                                                        "pending"
                                                    ]
                                                },
                                                "destination": {
                                                    "type": "string",
                                                    "example": "ivr:1"
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/schedules": {
            "get": {
                "summary": "Business hours with whether they are open now (read)",
                "responses": {
                    "200": {
                        "description": "Schedules",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "mode": {
                                                        "type": "string",
                                                        "enum": [
                                                            "auto",
                                                            "open",
                                                            "closed"
                                                        ]
                                                    },
                                                    "open_now": {
                                                        "type": "boolean"
                                                    },
                                                    "week": {
                                                        "type": "object",
                                                        "description": "mon … sun: [{from, to}] in Turkey time."
                                                    },
                                                    "holidays": {
                                                        "type": "array",
                                                        "items": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "open_destination": {
                                                        "type": "string"
                                                    },
                                                    "closed_destination": {
                                                        "type": "string"
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/schedules/{id}": {
            "get": {
                "summary": "One schedule (read)",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Schedule",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "mode": {
                                                    "type": "string",
                                                    "enum": [
                                                        "auto",
                                                        "open",
                                                        "closed"
                                                    ]
                                                },
                                                "open_now": {
                                                    "type": "boolean"
                                                },
                                                "week": {
                                                    "type": "object",
                                                    "description": "mon … sun: [{from, to}] in Turkey time."
                                                },
                                                "holidays": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "open_destination": {
                                                    "type": "string"
                                                },
                                                "closed_destination": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "patch": {
                "summary": "Force open or closed, back to automatic, or replace holidays (manage)",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "mode": {
                                        "type": "string",
                                        "enum": [
                                            "auto",
                                            "open",
                                            "closed"
                                        ]
                                    },
                                    "holidays": {
                                        "type": "array",
                                        "items": {
                                            "type": "string",
                                            "example": "2026-10-29"
                                        },
                                        "maxItems": 120
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Schedule",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "name": {
                                                    "type": "string"
                                                },
                                                "mode": {
                                                    "type": "string",
                                                    "enum": [
                                                        "auto",
                                                        "open",
                                                        "closed"
                                                    ]
                                                },
                                                "open_now": {
                                                    "type": "boolean"
                                                },
                                                "week": {
                                                    "type": "object",
                                                    "description": "mon … sun: [{from, to}] in Turkey time."
                                                },
                                                "holidays": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    }
                                                },
                                                "open_destination": {
                                                    "type": "string"
                                                },
                                                "closed_destination": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/calls/{id}/notes": {
            "get": {
                "summary": "Disposition, tags and note of a call (read)",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Notes",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "allOf": [
                                                {
                                                    "type": "object",
                                                    "properties": {
                                                        "disposition": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "maxLength": 40,
                                                            "example": "sale"
                                                        },
                                                        "tags": {
                                                            "type": "array",
                                                            "maxItems": 10,
                                                            "items": {
                                                                "type": "string",
                                                                "maxLength": 30
                                                            }
                                                        },
                                                        "note": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "maxLength": 2000
                                                        }
                                                    }
                                                },
                                                {
                                                    "type": "object",
                                                    "properties": {
                                                        "updated_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "format": "date-time"
                                                        }
                                                    }
                                                }
                                            ]
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "put": {
                "summary": "Replace them (call); also PATCH /calls/{id} to change only the fields sent. Works during the call too.",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "disposition": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 40,
                                        "example": "sale"
                                    },
                                    "tags": {
                                        "type": "array",
                                        "maxItems": 10,
                                        "items": {
                                            "type": "string",
                                            "maxLength": 30
                                        }
                                    },
                                    "note": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 2000
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Notes",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "allOf": [
                                                {
                                                    "type": "object",
                                                    "properties": {
                                                        "disposition": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "maxLength": 40,
                                                            "example": "sale"
                                                        },
                                                        "tags": {
                                                            "type": "array",
                                                            "maxItems": 10,
                                                            "items": {
                                                                "type": "string",
                                                                "maxLength": 30
                                                            }
                                                        },
                                                        "note": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "maxLength": 2000
                                                        }
                                                    }
                                                },
                                                {
                                                    "type": "object",
                                                    "properties": {
                                                        "updated_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "format": "date-time"
                                                        }
                                                    }
                                                }
                                            ]
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "patch": {
                "summary": "Change the fields sent (call)",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "disposition": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 40,
                                        "example": "sale"
                                    },
                                    "tags": {
                                        "type": "array",
                                        "maxItems": 10,
                                        "items": {
                                            "type": "string",
                                            "maxLength": 30
                                        }
                                    },
                                    "note": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 2000
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Notes",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "allOf": [
                                                {
                                                    "type": "object",
                                                    "properties": {
                                                        "disposition": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "maxLength": 40,
                                                            "example": "sale"
                                                        },
                                                        "tags": {
                                                            "type": "array",
                                                            "maxItems": 10,
                                                            "items": {
                                                                "type": "string",
                                                                "maxLength": 30
                                                            }
                                                        },
                                                        "note": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "maxLength": 2000
                                                        }
                                                    }
                                                },
                                                {
                                                    "type": "object",
                                                    "properties": {
                                                        "updated_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "format": "date-time"
                                                        }
                                                    }
                                                }
                                            ]
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/calls": {
            "get": {
                "summary": "Call history (read)",
                "parameters": [
                    {
                        "name": "from",
                        "in": "query",
                        "description": "Unix seconds, YYYY-MM-DD or ISO 8601 (default: 7 days ago).",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "description": "Unix seconds, YYYY-MM-DD or ISO 8601 (default: now). Range up to 93 days.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "direction",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "inbound",
                                "outbound",
                                "internal"
                            ]
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "answered",
                                "missed"
                            ]
                        }
                    },
                    {
                        "name": "number",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "extension",
                        "in": "query",
                        "description": "Calls with a leg of this extension (agent 1.12).",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "reference",
                        "in": "query",
                        "description": "Calls of click-to-calls sent with this reference (agent 1.12).",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Calls",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Call"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "post": {
                "summary": "Click-to-call (call): the extension rings, then the number is called",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "extension",
                                    "number"
                                ],
                                "properties": {
                                    "extension": {
                                        "type": "string",
                                        "example": "101"
                                    },
                                    "number": {
                                        "type": "string",
                                        "example": "05321234567"
                                    },
                                    "ring": {
                                        "type": "integer",
                                        "minimum": 10,
                                        "maximum": 60
                                    },
                                    "reference": {
                                        "type": "string",
                                        "maxLength": 100,
                                        "example": "deal-4821",
                                        "description": "Your own id (contact, deal, ticket); returned in call.ringing, call.answered, call.ended and call history."
                                    },
                                    "caller_id": {
                                        "oneOf": [
                                            {
                                                "type": "string"
                                            },
                                            {
                                                "type": "integer"
                                            }
                                        ],
                                        "description": "One of your active numbers shown to the person called, for this call only (agent 1.12)."
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "202": {
                        "description": "Ringing the extension",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "status": {
                                                    "type": "string"
                                                },
                                                "request_id": {
                                                    "type": "string",
                                                    "example": "c2c_ghkmnpqrstuv"
                                                },
                                                "reference": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "extension": {
                                                    "type": "string"
                                                },
                                                "number": {
                                                    "type": "string"
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/calls/{id}": {
            "get": {
                "summary": "One call of the last 93 days (read, agent 1.12)",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Call",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Call"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/Error"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "patch": {
                "summary": "Disposition, tags and note: changes the fields sent (call); same as PATCH /calls/{id}/notes",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "disposition": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 40,
                                        "example": "sale"
                                    },
                                    "tags": {
                                        "type": "array",
                                        "maxItems": 10,
                                        "items": {
                                            "type": "string",
                                            "maxLength": 30
                                        }
                                    },
                                    "note": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 2000
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Notes",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "allOf": [
                                                {
                                                    "type": "object",
                                                    "properties": {
                                                        "disposition": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "maxLength": 40,
                                                            "example": "sale"
                                                        },
                                                        "tags": {
                                                            "type": "array",
                                                            "maxItems": 10,
                                                            "items": {
                                                                "type": "string",
                                                                "maxLength": 30
                                                            }
                                                        },
                                                        "note": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "maxLength": 2000
                                                        }
                                                    }
                                                },
                                                {
                                                    "type": "object",
                                                    "properties": {
                                                        "updated_at": {
                                                            "type": [
                                                                "string",
                                                                "null"
                                                            ],
                                                            "format": "date-time"
                                                        }
                                                    }
                                                }
                                            ]
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/calls/{id}/recording": {
            "delete": {
                "summary": "Delete the recording of a call, e.g. for a data protection request; the call record stays (manage, agent 1.12)",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/Error"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "get": {
                "summary": "Call recording as WAV (read)",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Recording",
                        "content": {
                            "audio/wav": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/sounds": {
            "get": {
                "summary": "Ready audio files, e.g. announcements for campaigns (dialer)",
                "responses": {
                    "200": {
                        "description": "Sounds",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "seconds": {
                                                        "type": "integer"
                                                    },
                                                    "from_text": {
                                                        "type": "boolean"
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "post": {
                "summary": "Create an audio file from text (dialer). Counts against the monthly character allowance; the same text and voice are not charged twice.",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "name",
                                    "text"
                                ],
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "maxLength": 60,
                                        "example": "Kampanya duyurusu"
                                    },
                                    "text": {
                                        "type": "string",
                                        "maxLength": 1500,
                                        "example": "Merhaba, size özel kampanyamız için bire basın."
                                    },
                                    "voice": {
                                        "type": "string",
                                        "description": "Voice id from GET /voices (default: the default voice)."
                                    },
                                    "speed": {
                                        "type": "string",
                                        "enum": [
                                            "slow",
                                            "normal",
                                            "fast"
                                        ],
                                        "default": "normal"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created; \"status\" is \"ready\" or, while the PBX converts it, \"pending\"",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/SpokenSound"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "503": {
                        "$ref": "#/components/responses/Error"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/sounds/{id}": {
            "patch": {
                "summary": "New text, voice or speed for an audio file made from text; menus and campaigns that use it play the new audio (dialer)",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "maxLength": 60,
                                        "example": "Kampanya duyurusu"
                                    },
                                    "text": {
                                        "type": "string",
                                        "maxLength": 1500,
                                        "example": "Merhaba, size özel kampanyamız için bire basın."
                                    },
                                    "voice": {
                                        "type": "string",
                                        "description": "Voice id from GET /voices (default: the default voice)."
                                    },
                                    "speed": {
                                        "type": "string",
                                        "enum": [
                                            "slow",
                                            "normal",
                                            "fast"
                                        ],
                                        "default": "normal"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Updated",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/SpokenSound"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "409": {
                        "$ref": "#/components/responses/Error"
                    },
                    "503": {
                        "$ref": "#/components/responses/Error"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/voices": {
            "get": {
                "summary": "Voices for audio from text and this month's character allowance (dialer)",
                "responses": {
                    "200": {
                        "description": "Voices",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "string",
                                                        "example": "v3f9a1c20b7"
                                                    },
                                                    "name": {
                                                        "type": "string"
                                                    },
                                                    "description": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "default": {
                                                        "type": "boolean"
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/destinations": {
            "get": {
                "summary": "Where calls can be sent: extensions, voicemail, queues, ring groups, menus, schedules, announcements (read or dialer)",
                "responses": {
                    "200": {
                        "description": "Destinations",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/campaigns": {
            "get": {
                "summary": "Campaigns (dialer)",
                "responses": {
                    "200": {
                        "description": "Campaigns",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Campaign"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "post": {
                "summary": "Create a campaign (dialer)",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "allOf": [
                                    {
                                        "type": "object",
                                        "properties": {
                                            "name": {
                                                "type": "string",
                                                "maxLength": 80
                                            },
                                            "mode": {
                                                "type": "string",
                                                "enum": [
                                                    "broadcast",
                                                    "agent"
                                                ]
                                            },
                                            "sound_id": {
                                                "type": "integer",
                                                "description": "Announcement played in broadcast campaigns (GET /sounds)."
                                            },
                                            "press1": {
                                                "type": "string",
                                                "description": "Broadcast: where key 1 connects, e.g. \"queue:3\" (GET /destinations)."
                                            },
                                            "destination": {
                                                "type": "string",
                                                "description": "Agent campaign: where answered calls go, e.g. \"queue:3\"."
                                            },
                                            "caller_id": {
                                                "oneOf": [
                                                    {
                                                        "type": "string",
                                                        "description": "One of your approved numbers, e.g. \"+908503021161\"."
                                                    },
                                                    {
                                                        "type": "integer",
                                                        "description": "Number id from GET /numbers."
                                                    }
                                                ]
                                            },
                                            "channels": {
                                                "type": "integer",
                                                "minimum": 1
                                            },
                                            "ring": {
                                                "type": "integer",
                                                "minimum": 15,
                                                "maximum": 60
                                            },
                                            "retries": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 3
                                            },
                                            "retry_minutes": {
                                                "type": "integer",
                                                "minimum": 10,
                                                "maximum": 240
                                            },
                                            "window_from": {
                                                "type": "string",
                                                "example": "09:00"
                                            },
                                            "window_to": {
                                                "type": "string",
                                                "example": "20:00"
                                            },
                                            "days": {
                                                "type": "array",
                                                "items": {
                                                    "type": "integer",
                                                    "minimum": 1,
                                                    "maximum": 7
                                                },
                                                "description": "1 = Monday … 7 = Sunday."
                                            },
                                            "start_at": {
                                                "type": "string",
                                                "description": "Optional scheduled start, Turkey time, e.g. \"2026-10-20T10:00\"."
                                            }
                                        }
                                    },
                                    {
                                        "type": "object",
                                        "required": [
                                            "name",
                                            "mode",
                                            "caller_id",
                                            "numbers",
                                            "consent"
                                        ],
                                        "properties": {
                                            "numbers": {
                                                "type": "array",
                                                "maxItems": 10000,
                                                "items": {
                                                    "oneOf": [
                                                        {
                                                            "type": "string",
                                                            "example": "05321234567"
                                                        },
                                                        {
                                                            "type": "object",
                                                            "properties": {
                                                                "number": {
                                                                    "type": "string"
                                                                },
                                                                "name": {
                                                                    "type": "string"
                                                                }
                                                            },
                                                            "required": [
                                                                "number"
                                                            ]
                                                        }
                                                    ]
                                                }
                                            },
                                            "consent": {
                                                "type": "boolean",
                                                "const": true,
                                                "description": "You confirm you have the consent of the people to be called (İYS for commercial calls)."
                                            },
                                            "start": {
                                                "type": "boolean"
                                            }
                                        }
                                    }
                                ]
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Created",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Campaign"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/campaigns/{id}": {
            "get": {
                "summary": "Campaign (dialer)",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Campaign",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Campaign"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "patch": {
                "summary": "Change a paused campaign (dialer)",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "maxLength": 80
                                    },
                                    "mode": {
                                        "type": "string",
                                        "enum": [
                                            "broadcast",
                                            "agent"
                                        ]
                                    },
                                    "sound_id": {
                                        "type": "integer",
                                        "description": "Announcement played in broadcast campaigns (GET /sounds)."
                                    },
                                    "press1": {
                                        "type": "string",
                                        "description": "Broadcast: where key 1 connects, e.g. \"queue:3\" (GET /destinations)."
                                    },
                                    "destination": {
                                        "type": "string",
                                        "description": "Agent campaign: where answered calls go, e.g. \"queue:3\"."
                                    },
                                    "caller_id": {
                                        "oneOf": [
                                            {
                                                "type": "string",
                                                "description": "One of your approved numbers, e.g. \"+908503021161\"."
                                            },
                                            {
                                                "type": "integer",
                                                "description": "Number id from GET /numbers."
                                            }
                                        ]
                                    },
                                    "channels": {
                                        "type": "integer",
                                        "minimum": 1
                                    },
                                    "ring": {
                                        "type": "integer",
                                        "minimum": 15,
                                        "maximum": 60
                                    },
                                    "retries": {
                                        "type": "integer",
                                        "minimum": 0,
                                        "maximum": 3
                                    },
                                    "retry_minutes": {
                                        "type": "integer",
                                        "minimum": 10,
                                        "maximum": 240
                                    },
                                    "window_from": {
                                        "type": "string",
                                        "example": "09:00"
                                    },
                                    "window_to": {
                                        "type": "string",
                                        "example": "20:00"
                                    },
                                    "days": {
                                        "type": "array",
                                        "items": {
                                            "type": "integer",
                                            "minimum": 1,
                                            "maximum": 7
                                        },
                                        "description": "1 = Monday … 7 = Sunday."
                                    },
                                    "start_at": {
                                        "type": "string",
                                        "description": "Optional scheduled start, Turkey time, e.g. \"2026-10-20T10:00\"."
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Campaign",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Campaign"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "delete": {
                "summary": "Delete a finished, cancelled or never-dialled campaign with its numbers (dialer)",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/campaigns/{id}/numbers": {
            "post": {
                "summary": "Add numbers (dialer)",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "numbers"
                                ],
                                "properties": {
                                    "numbers": {
                                        "type": "array",
                                        "maxItems": 10000,
                                        "items": {
                                            "oneOf": [
                                                {
                                                    "type": "string",
                                                    "example": "05321234567"
                                                },
                                                {
                                                    "type": "object",
                                                    "properties": {
                                                        "number": {
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "required": [
                                                        "number"
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Campaign",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Campaign"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/campaigns/{id}/start": {
            "post": {
                "summary": "Start or resume (dialer)",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Campaign",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Campaign"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/campaigns/{id}/pause": {
            "post": {
                "summary": "Pause (dialer)",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Campaign",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Campaign"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/campaigns/{id}/cancel": {
            "post": {
                "summary": "Cancel; waiting numbers are not called (dialer)",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Campaign",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Campaign"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/campaigns/{id}/results": {
            "get": {
                "summary": "Per-number results (dialer)",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Results",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/CampaignNumber"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/dnc": {
            "get": {
                "summary": "Do-not-call list (dialer)",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Numbers",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "post": {
                "summary": "Add numbers to the do-not-call list (dialer)",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "numbers"
                                ],
                                "properties": {
                                    "numbers": {
                                        "type": "array",
                                        "maxItems": 10000,
                                        "items": {
                                            "oneOf": [
                                                {
                                                    "type": "string",
                                                    "example": "05321234567"
                                                },
                                                {
                                                    "type": "object",
                                                    "properties": {
                                                        "number": {
                                                            "type": "string"
                                                        },
                                                        "name": {
                                                            "type": "string"
                                                        }
                                                    },
                                                    "required": [
                                                        "number"
                                                    ]
                                                }
                                            ]
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Added",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/voicemails": {
            "get": {
                "summary": "Voicemail of every mailbox, newest first (read, agent 1.12)",
                "parameters": [
                    {
                        "name": "extension",
                        "in": "query",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "new",
                        "in": "query",
                        "description": "true: only messages not yet listened to.",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "true"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Voicemails",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Voicemail"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/voicemails/{id}": {
            "delete": {
                "summary": "Delete a voicemail (manage)",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "201-1792340000-0000001a"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/Error"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/voicemails/{id}/audio": {
            "get": {
                "summary": "Voicemail audio as WAV (read)",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Audio",
                        "content": {
                            "audio/wav": {
                                "schema": {
                                    "type": "string",
                                    "format": "binary"
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/events": {
            "get": {
                "summary": "Events queued for your webhook in the last 14 days, oldest first, to catch up after downtime (read). An OAuth app sees the events of its own webhook.",
                "parameters": [
                    {
                        "name": "after",
                        "in": "query",
                        "description": "seq of the last event you have (meta.next_after of the previous page).",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "limit",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "maximum": 500
                        }
                    },
                    {
                        "name": "event",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "call.ringing",
                                "call.answered",
                                "call.ended",
                                "call.updated",
                                "agent.status",
                                "dialer.result",
                                "voicemail.received",
                                "callback.updated",
                                "queue.alert"
                            ]
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Events",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "seq": {
                                                        "type": "integer"
                                                    },
                                                    "id": {
                                                        "type": "string"
                                                    },
                                                    "event": {
                                                        "type": "string"
                                                    },
                                                    "created_at": {
                                                        "type": "string"
                                                    },
                                                    "delivery": {
                                                        "type": "string",
                                                        "enum": [
                                                            "queued",
                                                            "sent",
                                                            "failed",
                                                            "cancelled"
                                                        ]
                                                    },
                                                    "attempts": {
                                                        "type": "integer"
                                                    },
                                                    "data": {
                                                        "type": "object"
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/events/{id}/redeliver": {
            "post": {
                "summary": "Send an event to the webhook again (manage; an OAuth app: read)",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "evt_3f2a…"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "responses": {
                    "202": {
                        "description": "Queued",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/Error"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/webhook": {
            "get": {
                "summary": "The webhook of this key's account, or of the OAuth app (manage; an OAuth app: read)",
                "responses": {
                    "200": {
                        "description": "Webhook or null",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": [
                                                "object",
                                                "null"
                                            ]
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "put": {
                "summary": "Set the webhook; the signing secret is returned once when it is new",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "url"
                                ],
                                "properties": {
                                    "url": {
                                        "type": "string",
                                        "example": "https://crm.example.com/teksantral/events"
                                    },
                                    "events": {
                                        "type": "array",
                                        "items": {
                                            "type": "string",
                                            "enum": [
                                                "call.ringing",
                                                "call.answered",
                                                "call.ended",
                                                "call.updated",
                                                "agent.status",
                                                "dialer.result",
                                                "voicemail.received",
                                                "callback.updated",
                                                "queue.alert"
                                            ]
                                        }
                                    },
                                    "enabled": {
                                        "type": "boolean",
                                        "default": true
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Webhook",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "delete": {
                "summary": "Remove the webhook",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/webhook/secret": {
            "post": {
                "summary": "New signing secret",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Secret",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/webhook/test": {
            "post": {
                "summary": "Send a test event",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "responses": {
                    "202": {
                        "description": "Queued",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/callbacks": {
            "get": {
                "summary": "Callback list (read)",
                "parameters": [
                    {
                        "name": "status",
                        "in": "query",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "waiting",
                                "calling",
                                "open",
                                "done",
                                "active",
                                "todo",
                                "all"
                            ],
                            "default": "todo"
                        }
                    },
                    {
                        "name": "queue_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "maximum": 500
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Callbacks",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "type": "object",
                                                "properties": {
                                                    "id": {
                                                        "type": "integer"
                                                    },
                                                    "queue_id": {
                                                        "type": "integer"
                                                    },
                                                    "queue_name": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "number": {
                                                        "type": "string",
                                                        "example": "+905321234567"
                                                    },
                                                    "status": {
                                                        "type": "string",
                                                        "enum": [
                                                            "waiting",
                                                            "calling",
                                                            "open",
                                                            "done"
                                                        ],
                                                        "description": "waiting: in the queue; calling: an agent is connected and the customer rings; open: on the list to call; done."
                                                    },
                                                    "result": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ],
                                                        "enum": [
                                                            "answered",
                                                            "busy",
                                                            "noanswer",
                                                            "failed",
                                                            "expired",
                                                            "cancelled",
                                                            "lost",
                                                            "missed",
                                                            "reached",
                                                            "called",
                                                            "closed",
                                                            null
                                                        ]
                                                    },
                                                    "source": {
                                                        "type": "string",
                                                        "enum": [
                                                            "caller",
                                                            "missed",
                                                            "panel",
                                                            "api"
                                                        ]
                                                    },
                                                    "agent": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "attempts": {
                                                        "type": "integer"
                                                    },
                                                    "note": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ]
                                                    },
                                                    "talk_time": {
                                                        "type": "integer"
                                                    },
                                                    "scheduled_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ],
                                                        "format": "date-time",
                                                        "description": "Planned time (result \"scheduled\"); it joins the queue then."
                                                    },
                                                    "created_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "updated_at": {
                                                        "type": "string",
                                                        "format": "date-time"
                                                    },
                                                    "completed_at": {
                                                        "type": [
                                                            "string",
                                                            "null"
                                                        ],
                                                        "format": "date-time"
                                                    }
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "post": {
                "summary": "Add a callback; by default it waits in the queue and is called when an agent is free (call)",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "queue_id",
                                    "number"
                                ],
                                "properties": {
                                    "queue_id": {
                                        "type": "integer"
                                    },
                                    "number": {
                                        "type": "string",
                                        "example": "05321234567"
                                    },
                                    "note": {
                                        "type": "string",
                                        "maxLength": 500
                                    },
                                    "queue": {
                                        "type": "boolean",
                                        "default": true,
                                        "description": "false only adds it to the list."
                                    },
                                    "at": {
                                        "type": "string",
                                        "example": "2026-10-20T15:00",
                                        "description": "Plan the callback (Turkey time, or unix seconds / ISO 8601; 1 minute to 30 days ahead); it joins the queue then."
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "201": {
                        "description": "Callback",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "queue_id": {
                                                    "type": "integer"
                                                },
                                                "queue_name": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "number": {
                                                    "type": "string",
                                                    "example": "+905321234567"
                                                },
                                                "status": {
                                                    "type": "string",
                                                    "enum": [
                                                        "waiting",
                                                        "calling",
                                                        "open",
                                                        "done"
                                                    ],
                                                    "description": "waiting: in the queue; calling: an agent is connected and the customer rings; open: on the list to call; done."
                                                },
                                                "result": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "enum": [
                                                        "answered",
                                                        "busy",
                                                        "noanswer",
                                                        "failed",
                                                        "expired",
                                                        "cancelled",
                                                        "lost",
                                                        "missed",
                                                        "reached",
                                                        "called",
                                                        "closed",
                                                        null
                                                    ]
                                                },
                                                "source": {
                                                    "type": "string",
                                                    "enum": [
                                                        "caller",
                                                        "missed",
                                                        "panel",
                                                        "api"
                                                    ]
                                                },
                                                "agent": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "attempts": {
                                                    "type": "integer"
                                                },
                                                "note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "talk_time": {
                                                    "type": "integer"
                                                },
                                                "scheduled_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time",
                                                    "description": "Planned time (result \"scheduled\"); it joins the queue then."
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "completed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "200": {
                        "description": "Already waiting (meta.duplicate)",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "queue_id": {
                                                    "type": "integer"
                                                },
                                                "queue_name": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "number": {
                                                    "type": "string",
                                                    "example": "+905321234567"
                                                },
                                                "status": {
                                                    "type": "string",
                                                    "enum": [
                                                        "waiting",
                                                        "calling",
                                                        "open",
                                                        "done"
                                                    ],
                                                    "description": "waiting: in the queue; calling: an agent is connected and the customer rings; open: on the list to call; done."
                                                },
                                                "result": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "enum": [
                                                        "answered",
                                                        "busy",
                                                        "noanswer",
                                                        "failed",
                                                        "expired",
                                                        "cancelled",
                                                        "lost",
                                                        "missed",
                                                        "reached",
                                                        "called",
                                                        "closed",
                                                        null
                                                    ]
                                                },
                                                "source": {
                                                    "type": "string",
                                                    "enum": [
                                                        "caller",
                                                        "missed",
                                                        "panel",
                                                        "api"
                                                    ]
                                                },
                                                "agent": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "attempts": {
                                                    "type": "integer"
                                                },
                                                "note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "talk_time": {
                                                    "type": "integer"
                                                },
                                                "scheduled_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time",
                                                    "description": "Planned time (result \"scheduled\"); it joins the queue then."
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "completed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/callbacks/{id}": {
            "get": {
                "summary": "One callback (read)",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Callback",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "queue_id": {
                                                    "type": "integer"
                                                },
                                                "queue_name": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "number": {
                                                    "type": "string",
                                                    "example": "+905321234567"
                                                },
                                                "status": {
                                                    "type": "string",
                                                    "enum": [
                                                        "waiting",
                                                        "calling",
                                                        "open",
                                                        "done"
                                                    ],
                                                    "description": "waiting: in the queue; calling: an agent is connected and the customer rings; open: on the list to call; done."
                                                },
                                                "result": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "enum": [
                                                        "answered",
                                                        "busy",
                                                        "noanswer",
                                                        "failed",
                                                        "expired",
                                                        "cancelled",
                                                        "lost",
                                                        "missed",
                                                        "reached",
                                                        "called",
                                                        "closed",
                                                        null
                                                    ]
                                                },
                                                "source": {
                                                    "type": "string",
                                                    "enum": [
                                                        "caller",
                                                        "missed",
                                                        "panel",
                                                        "api"
                                                    ]
                                                },
                                                "agent": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "attempts": {
                                                    "type": "integer"
                                                },
                                                "note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "talk_time": {
                                                    "type": "integer"
                                                },
                                                "scheduled_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time",
                                                    "description": "Planned time (result \"scheduled\"); it joins the queue then."
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "completed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "patch": {
                "summary": "Close or reopen, note, queue (call)",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "status": {
                                        "type": "string",
                                        "enum": [
                                            "open",
                                            "done"
                                        ]
                                    },
                                    "note": {
                                        "type": [
                                            "string",
                                            "null"
                                        ]
                                    },
                                    "queue_id": {
                                        "type": "integer"
                                    },
                                    "at": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "description": "Plan or (null) unplan an open callback."
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Callback",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "queue_id": {
                                                    "type": "integer"
                                                },
                                                "queue_name": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "number": {
                                                    "type": "string",
                                                    "example": "+905321234567"
                                                },
                                                "status": {
                                                    "type": "string",
                                                    "enum": [
                                                        "waiting",
                                                        "calling",
                                                        "open",
                                                        "done"
                                                    ],
                                                    "description": "waiting: in the queue; calling: an agent is connected and the customer rings; open: on the list to call; done."
                                                },
                                                "result": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "enum": [
                                                        "answered",
                                                        "busy",
                                                        "noanswer",
                                                        "failed",
                                                        "expired",
                                                        "cancelled",
                                                        "lost",
                                                        "missed",
                                                        "reached",
                                                        "called",
                                                        "closed",
                                                        null
                                                    ]
                                                },
                                                "source": {
                                                    "type": "string",
                                                    "enum": [
                                                        "caller",
                                                        "missed",
                                                        "panel",
                                                        "api"
                                                    ]
                                                },
                                                "agent": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "attempts": {
                                                    "type": "integer"
                                                },
                                                "note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "talk_time": {
                                                    "type": "integer"
                                                },
                                                "scheduled_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time",
                                                    "description": "Planned time (result \"scheduled\"); it joins the queue then."
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "completed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "delete": {
                "summary": "Take out of the queue and delete (call)",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/callbacks/{id}/requeue": {
            "post": {
                "summary": "Put back into its queue (call)",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Callback",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "queue_id": {
                                                    "type": "integer"
                                                },
                                                "queue_name": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "number": {
                                                    "type": "string",
                                                    "example": "+905321234567"
                                                },
                                                "status": {
                                                    "type": "string",
                                                    "enum": [
                                                        "waiting",
                                                        "calling",
                                                        "open",
                                                        "done"
                                                    ],
                                                    "description": "waiting: in the queue; calling: an agent is connected and the customer rings; open: on the list to call; done."
                                                },
                                                "result": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "enum": [
                                                        "answered",
                                                        "busy",
                                                        "noanswer",
                                                        "failed",
                                                        "expired",
                                                        "cancelled",
                                                        "lost",
                                                        "missed",
                                                        "reached",
                                                        "called",
                                                        "closed",
                                                        null
                                                    ]
                                                },
                                                "source": {
                                                    "type": "string",
                                                    "enum": [
                                                        "caller",
                                                        "missed",
                                                        "panel",
                                                        "api"
                                                    ]
                                                },
                                                "agent": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "attempts": {
                                                    "type": "integer"
                                                },
                                                "note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "talk_time": {
                                                    "type": "integer"
                                                },
                                                "scheduled_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time",
                                                    "description": "Planned time (result \"scheduled\"); it joins the queue then."
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "completed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/callbacks/{id}/call": {
            "post": {
                "summary": "Click-to-call the number from an extension; the item stays open (call)",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "extension"
                                ],
                                "properties": {
                                    "extension": {
                                        "type": "string",
                                        "example": "201"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "202": {
                        "description": "Calling",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "id": {
                                                    "type": "integer"
                                                },
                                                "queue_id": {
                                                    "type": "integer"
                                                },
                                                "queue_name": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "number": {
                                                    "type": "string",
                                                    "example": "+905321234567"
                                                },
                                                "status": {
                                                    "type": "string",
                                                    "enum": [
                                                        "waiting",
                                                        "calling",
                                                        "open",
                                                        "done"
                                                    ],
                                                    "description": "waiting: in the queue; calling: an agent is connected and the customer rings; open: on the list to call; done."
                                                },
                                                "result": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "enum": [
                                                        "answered",
                                                        "busy",
                                                        "noanswer",
                                                        "failed",
                                                        "expired",
                                                        "cancelled",
                                                        "lost",
                                                        "missed",
                                                        "reached",
                                                        "called",
                                                        "closed",
                                                        null
                                                    ]
                                                },
                                                "source": {
                                                    "type": "string",
                                                    "enum": [
                                                        "caller",
                                                        "missed",
                                                        "panel",
                                                        "api"
                                                    ]
                                                },
                                                "agent": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "attempts": {
                                                    "type": "integer"
                                                },
                                                "note": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ]
                                                },
                                                "talk_time": {
                                                    "type": "integer"
                                                },
                                                "scheduled_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time",
                                                    "description": "Planned time (result \"scheduled\"); it joins the queue then."
                                                },
                                                "created_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "updated_at": {
                                                    "type": "string",
                                                    "format": "date-time"
                                                },
                                                "completed_at": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "format": "date-time"
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/contacts": {
            "get": {
                "summary": "Phonebook (read)",
                "parameters": [
                    {
                        "name": "search",
                        "in": "query",
                        "description": "Part of a name or number.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "external_id",
                        "in": "query",
                        "description": "Your CRM record id: the contacts carrying it.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "schema": {
                            "type": "integer",
                            "minimum": 1
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contacts",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/Contact"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "post": {
                "summary": "Add or replace up to 1000 contacts; invalid items are listed, the rest saved (manage)",
                "parameters": [
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "required": [
                                    "contacts"
                                ],
                                "properties": {
                                    "contacts": {
                                        "type": "array",
                                        "maxItems": 1000,
                                        "items": {
                                            "type": "object",
                                            "properties": {
                                                "number": {
                                                    "type": "string",
                                                    "example": "+905321234567"
                                                },
                                                "external_id": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "maxLength": 100,
                                                    "description": "Your CRM's record id, returned with calls and call events (screen pop). GET /contacts?external_id=… finds it."
                                                },
                                                "name": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "maxLength": 60,
                                                    "example": "Ahmet Yılmaz",
                                                    "description": "Shown on the agents' phones when this number calls. Letters, digits, spaces and . & @ + / ' _ - (other characters become spaces)."
                                                },
                                                "owner": {
                                                    "type": [
                                                        "string",
                                                        "null"
                                                    ],
                                                    "example": "201",
                                                    "description": "Account owner extension, rung first by queues with owner_first."
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Saved",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object",
                                            "properties": {
                                                "saved": {
                                                    "type": "integer"
                                                },
                                                "invalid": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "object"
                                                    }
                                                },
                                                "total": {
                                                    "type": "integer"
                                                }
                                            }
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "pbx": {
                                                    "type": "string",
                                                    "enum": [
                                                        "applied",
                                                        "queued",
                                                        "service_inactive"
                                                    ],
                                                    "description": "applied: live now; queued: reaches the PBX within about a minute."
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "delete": {
                "summary": "Delete the whole phonebook; needs ?all=true (manage)",
                "parameters": [
                    {
                        "name": "all",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "const": "true"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "pbx": {
                                                    "type": "string",
                                                    "enum": [
                                                        "applied",
                                                        "queued",
                                                        "service_inactive"
                                                    ],
                                                    "description": "applied: live now; queued: reaches the PBX within about a minute."
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/contacts/{number}": {
            "get": {
                "summary": "One contact (read)",
                "parameters": [
                    {
                        "name": "number",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "+905321234567"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Contact",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Contact"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/Error"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "put": {
                "summary": "Add or replace one contact (manage)",
                "parameters": [
                    {
                        "name": "number",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "number": {
                                        "type": "string",
                                        "example": "+905321234567"
                                    },
                                    "external_id": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 100,
                                        "description": "Your CRM's record id, returned with calls and call events (screen pop). GET /contacts?external_id=… finds it."
                                    },
                                    "name": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "maxLength": 60,
                                        "example": "Ahmet Yılmaz",
                                        "description": "Shown on the agents' phones when this number calls. Letters, digits, spaces and . & @ + / ' _ - (other characters become spaces)."
                                    },
                                    "owner": {
                                        "type": [
                                            "string",
                                            "null"
                                        ],
                                        "example": "201",
                                        "description": "Account owner extension, rung first by queues with owner_first."
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Contact",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/components/schemas/Contact"
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "pbx": {
                                                    "type": "string",
                                                    "enum": [
                                                        "applied",
                                                        "queued",
                                                        "service_inactive"
                                                    ],
                                                    "description": "applied: live now; queued: reaches the PBX within about a minute."
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            },
            "delete": {
                "summary": "Delete one contact (manage)",
                "parameters": [
                    {
                        "name": "number",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Deleted",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        },
                                        "meta": {
                                            "type": "object",
                                            "properties": {
                                                "pbx": {
                                                    "type": "string",
                                                    "enum": [
                                                        "applied",
                                                        "queued",
                                                        "service_inactive"
                                                    ],
                                                    "description": "applied: live now; queued: reaches the PBX within about a minute."
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "404": {
                        "$ref": "#/components/responses/Error"
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/reports/queues": {
            "get": {
                "summary": "Queue report: offered, answered, abandoned, waits, talk time, service level; up to 93 days (read)",
                "parameters": [
                    {
                        "name": "from",
                        "in": "query",
                        "description": "Unix seconds, YYYY-MM-DD or ISO 8601 (default: today 00:00 Turkey time).",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "description": "Default: now.",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "service_level",
                        "in": "query",
                        "description": "Seconds (default 20).",
                        "schema": {
                            "type": "integer",
                            "minimum": 1,
                            "maximum": 600
                        }
                    },
                    {
                        "name": "interval",
                        "in": "query",
                        "description": "Adds per-day or per-hour counts (hour: up to 7 days).",
                        "schema": {
                            "type": "string",
                            "enum": [
                                "day",
                                "hour"
                            ]
                        }
                    },
                    {
                        "name": "queue_id",
                        "in": "query",
                        "schema": {
                            "type": "integer"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Queues",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/QueueReport"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/reports/agents": {
            "get": {
                "summary": "Agent report: queue calls answered and missed, talk time, time logged in and on breaks by reason, direct inbound and outbound calls; up to 31 days (read)",
                "parameters": [
                    {
                        "name": "from",
                        "in": "query",
                        "description": "Unix seconds, YYYY-MM-DD or ISO 8601 (default: today 00:00 Turkey time).",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "description": "Default: now.",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Agents",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "array",
                                            "items": {
                                                "$ref": "#/components/schemas/AgentReport"
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        },
        "/dnc/{number}": {
            "delete": {
                "summary": "Remove a number from the do-not-call list (dialer)",
                "parameters": [
                    {
                        "name": "number",
                        "in": "path",
                        "required": true,
                        "schema": {
                            "type": "string",
                            "example": "+905321234567"
                        }
                    },
                    {
                        "name": "Idempotency-Key",
                        "in": "header",
                        "required": false,
                        "description": "Repeat a request safely: the first answer is returned again for 24 hours.",
                        "schema": {
                            "type": "string",
                            "minLength": 8,
                            "maxLength": 64
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Removed",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "type": "object"
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "400": {
                        "$ref": "#/components/responses/Error"
                    },
                    "401": {
                        "$ref": "#/components/responses/Error"
                    },
                    "403": {
                        "$ref": "#/components/responses/Error"
                    },
                    "429": {
                        "$ref": "#/components/responses/Error"
                    }
                }
            }
        }
    },
    "webhooks": {
        "call.ringing": {
            "post": {
                "summary": "An outside call rings an extension. data.call: call_id (the call record id once it ends), channel_id, direction, source, from or number, extension, device, queue_id; request_id and reference for click-to-call",
                "parameters": [
                    {
                        "name": "X-TekSantral-Signature",
                        "in": "header",
                        "required": true,
                        "description": "t=<unix time>,v1=<hex HMAC-SHA256 of \"<t>.<body>\" with your signing secret>",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "id": {
                                        "type": "string"
                                    },
                                    "event": {
                                        "type": "string"
                                    },
                                    "created_at": {
                                        "type": "string",
                                        "format": "date-time"
                                    },
                                    "account": {
                                        "type": "integer"
                                    },
                                    "data": {
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "2XX": {
                        "description": "Received. Any other answer is retried for up to 6 hours."
                    }
                }
            }
        },
        "call.answered": {
            "post": {
                "summary": "An extension answered the call (same fields as call.ringing)",
                "parameters": [
                    {
                        "name": "X-TekSantral-Signature",
                        "in": "header",
                        "required": true,
                        "description": "t=<unix time>,v1=<hex HMAC-SHA256 of \"<t>.<body>\" with your signing secret>",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "id": {
                                        "type": "string"
                                    },
                                    "event": {
                                        "type": "string"
                                    },
                                    "created_at": {
                                        "type": "string",
                                        "format": "date-time"
                                    },
                                    "account": {
                                        "type": "integer"
                                    },
                                    "data": {
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "2XX": {
                        "description": "Received. Any other answer is retried for up to 6 hours."
                    }
                }
            }
        },
        "call.ended": {
            "post": {
                "summary": "A call ended (inbound, outbound or internal)",
                "parameters": [
                    {
                        "name": "X-TekSantral-Signature",
                        "in": "header",
                        "required": true,
                        "description": "t=<unix time>,v1=<hex HMAC-SHA256 of \"<t>.<body>\" with your signing secret>",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "id": {
                                        "type": "string"
                                    },
                                    "event": {
                                        "type": "string"
                                    },
                                    "created_at": {
                                        "type": "string",
                                        "format": "date-time"
                                    },
                                    "account": {
                                        "type": "integer"
                                    },
                                    "data": {
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "2XX": {
                        "description": "Received. Any other answer is retried for up to 6 hours."
                    }
                }
            }
        },
        "call.updated": {
            "post": {
                "summary": "A call's disposition, tags or note changed. data.call: id, notes",
                "parameters": [
                    {
                        "name": "X-TekSantral-Signature",
                        "in": "header",
                        "required": true,
                        "description": "t=<unix time>,v1=<hex HMAC-SHA256 of \"<t>.<body>\" with your signing secret>",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "id": {
                                        "type": "string"
                                    },
                                    "event": {
                                        "type": "string"
                                    },
                                    "created_at": {
                                        "type": "string",
                                        "format": "date-time"
                                    },
                                    "account": {
                                        "type": "integer"
                                    },
                                    "data": {
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "2XX": {
                        "description": "Received. Any other answer is retried for up to 6 hours."
                    }
                }
            }
        },
        "agent.status": {
            "post": {
                "summary": "An agent's phone connected or disconnected, they logged in or out of a queue, or started or ended a break",
                "parameters": [
                    {
                        "name": "X-TekSantral-Signature",
                        "in": "header",
                        "required": true,
                        "description": "t=<unix time>,v1=<hex HMAC-SHA256 of \"<t>.<body>\" with your signing secret>",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "id": {
                                        "type": "string"
                                    },
                                    "event": {
                                        "type": "string"
                                    },
                                    "created_at": {
                                        "type": "string",
                                        "format": "date-time"
                                    },
                                    "account": {
                                        "type": "integer"
                                    },
                                    "data": {
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "2XX": {
                        "description": "Received. Any other answer is retried for up to 6 hours."
                    }
                }
            }
        },
        "dialer.result": {
            "post": {
                "summary": "A campaign number got a result",
                "parameters": [
                    {
                        "name": "X-TekSantral-Signature",
                        "in": "header",
                        "required": true,
                        "description": "t=<unix time>,v1=<hex HMAC-SHA256 of \"<t>.<body>\" with your signing secret>",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "id": {
                                        "type": "string"
                                    },
                                    "event": {
                                        "type": "string"
                                    },
                                    "created_at": {
                                        "type": "string",
                                        "format": "date-time"
                                    },
                                    "account": {
                                        "type": "integer"
                                    },
                                    "data": {
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "2XX": {
                        "description": "Received. Any other answer is retried for up to 6 hours."
                    }
                }
            }
        },
        "voicemail.received": {
            "post": {
                "summary": "A voicemail was left. data.voicemail: id, extension, from, caller_name, received_at, duration, new",
                "parameters": [
                    {
                        "name": "X-TekSantral-Signature",
                        "in": "header",
                        "required": true,
                        "description": "t=<unix time>,v1=<hex HMAC-SHA256 of \"<t>.<body>\" with your signing secret>",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "id": {
                                        "type": "string"
                                    },
                                    "event": {
                                        "type": "string"
                                    },
                                    "created_at": {
                                        "type": "string",
                                        "format": "date-time"
                                    },
                                    "account": {
                                        "type": "integer"
                                    },
                                    "data": {
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "2XX": {
                        "description": "Received. Any other answer is retried for up to 6 hours."
                    }
                }
            }
        },
        "callback.updated": {
            "post": {
                "summary": "A queue callback was requested, queued, connected, called or closed. data.callback: id, queue_id, number, status (waiting|calling|open|done), result, source, agent, attempts",
                "parameters": [
                    {
                        "name": "X-TekSantral-Signature",
                        "in": "header",
                        "required": true,
                        "description": "t=<unix time>,v1=<hex HMAC-SHA256 of \"<t>.<body>\" with your signing secret>",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "id": {
                                        "type": "string"
                                    },
                                    "event": {
                                        "type": "string"
                                    },
                                    "created_at": {
                                        "type": "string",
                                        "format": "date-time"
                                    },
                                    "account": {
                                        "type": "integer"
                                    },
                                    "data": {
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "2XX": {
                        "description": "Received. Any other answer is retried for up to 6 hours."
                    }
                }
            }
        },
        "queue.alert": {
            "post": {
                "summary": "A queue alert started, is still going on (repeat) or resolved. data.alert: queue_id, queue_name, rule (wait|waiting|no_agent|abandon_rate|service_level), state (firing|resolved), repeat, value, threshold, since",
                "parameters": [
                    {
                        "name": "X-TekSantral-Signature",
                        "in": "header",
                        "required": true,
                        "description": "t=<unix time>,v1=<hex HMAC-SHA256 of \"<t>.<body>\" with your signing secret>",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "requestBody": {
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "id": {
                                        "type": "string"
                                    },
                                    "event": {
                                        "type": "string"
                                    },
                                    "created_at": {
                                        "type": "string",
                                        "format": "date-time"
                                    },
                                    "account": {
                                        "type": "integer"
                                    },
                                    "data": {
                                        "type": "object"
                                    }
                                }
                            }
                        }
                    }
                },
                "responses": {
                    "2XX": {
                        "description": "Received. Any other answer is retried for up to 6 hours."
                    }
                }
            }
        }
    }
}