{
  "openapi": "3.1.0",
  "info": {
    "title": "Telyzer API",
    "version": "1",
    "description": "Read your organization\u0027s call records and reports. Create a key under Integrations in the Telyzer portal and send it as \u0060Authorization: Bearer tzk_\u2026\u0060. External numbers are masked unless the key has the \u0060calls.unmask\u0060 scope. Times ending in \u0060Local\u0060 are wall-clock times at the site; \u0060Utc\u0060 times are UTC."
  },
  "servers": [
    {
      "url": "https://app.telyzer.com"
    }
  ],
  "security": [
    {
      "bearer": []
    }
  ],
  "paths": {
    "/api/v1/calls": {
      "get": {
        "summary": "List calls (one row per conversation, newest first)",
        "description": "Needs an API key with the \u0060calls.read\u0060 scope.",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "First day (YYYY-MM-DD, your organization\u0027s timezone). Default: 6 days before \u0060to\u0060.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "Last day, inclusive. Default: today. At most 366 days per request.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "siteId",
            "in": "query",
            "required": false,
            "description": "Only this site.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "departmentId",
            "in": "query",
            "required": false,
            "description": "Only extensions in this department (as the directory is now).",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "description": "Call direction.",
            "schema": {
              "type": "string",
              "enum": [
                "inbound",
                "outbound",
                "internal"
              ]
            }
          },
          {
            "name": "outcome",
            "in": "query",
            "required": false,
            "description": "Call outcome.",
            "schema": {
              "type": "string",
              "enum": [
                "answered",
                "unanswered",
                "voicemail",
                "unknown"
              ]
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Type of the external number.",
            "schema": {
              "type": "string",
              "enum": [
                "internal",
                "local",
                "national",
                "mobile",
                "international",
                "toll_free",
                "premium",
                "withheld",
                "unknown"
              ]
            }
          },
          {
            "name": "extension",
            "in": "query",
            "required": false,
            "description": "Extension number.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "number",
            "in": "query",
            "required": false,
            "description": "Part of the external number (digits).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "afterHours",
            "in": "query",
            "required": false,
            "description": "Only calls outside (true) or inside (false) working hours.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "minTalk",
            "in": "query",
            "required": false,
            "description": "Minimum talk time in seconds.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "\u0060nextCursor\u0060 from the previous page.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Page size, 1\u2013200 (default 50).",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of calls.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CallPage"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "403": {
            "description": "The key lacks the scope this needs."
          },
          "429": {
            "description": "More than 300 requests a minute for this key."
          }
        }
      }
    },
    "/api/v1/calls/{id}": {
      "get": {
        "summary": "One call with every transfer segment and the raw PBX line",
        "description": "Needs an API key with the \u0060calls.read\u0060 scope.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            },
            "description": "Call id from the list."
          }
        ],
        "responses": {
          "200": {
            "description": "The call.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "403": {
            "description": "The key lacks the scope this needs."
          },
          "429": {
            "description": "More than 300 requests a minute for this key."
          }
        }
      }
    },
    "/api/v1/reports": {
      "get": {
        "summary": "Available reports",
        "description": "Needs an API key with the \u0060reports.read\u0060 scope.",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Report keys and titles.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "403": {
            "description": "The key lacks the scope this needs."
          },
          "429": {
            "description": "More than 300 requests a minute for this key."
          }
        }
      }
    },
    "/api/v1/reports/{key}": {
      "get": {
        "summary": "Run a report",
        "description": "Needs an API key with the \u0060reports.read\u0060 scope.",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "First day (YYYY-MM-DD, your organization\u0027s timezone). Default: 6 days before \u0060to\u0060.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "Last day, inclusive. Default: today. At most 366 days per request.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "siteId",
            "in": "query",
            "required": false,
            "description": "Only this site.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "departmentId",
            "in": "query",
            "required": false,
            "description": "Only extensions in this department (as the directory is now).",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "description": "Call direction.",
            "schema": {
              "type": "string",
              "enum": [
                "inbound",
                "outbound",
                "internal"
              ]
            }
          },
          {
            "name": "outcome",
            "in": "query",
            "required": false,
            "description": "Call outcome.",
            "schema": {
              "type": "string",
              "enum": [
                "answered",
                "unanswered",
                "voicemail",
                "unknown"
              ]
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Type of the external number.",
            "schema": {
              "type": "string",
              "enum": [
                "internal",
                "local",
                "national",
                "mobile",
                "international",
                "toll_free",
                "premium",
                "withheld",
                "unknown"
              ]
            }
          },
          {
            "name": "extension",
            "in": "query",
            "required": false,
            "description": "Extension number.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "number",
            "in": "query",
            "required": false,
            "description": "Part of the external number (digits).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "afterHours",
            "in": "query",
            "required": false,
            "description": "Only calls outside (true) or inside (false) working hours.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "minTalk",
            "in": "query",
            "required": false,
            "description": "Minimum talk time in seconds.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "summary",
                "daily",
                "hourly",
                "extensions",
                "unanswered",
                "top-numbers",
                "destinations",
                "sites",
                "costs",
                "after-hours",
                "service-level",
                "callers",
                "trunks",
                "account-codes",
                "data-quality",
                "calls"
              ]
            },
            "description": "Report key."
          }
        ],
        "responses": {
          "200": {
            "description": "Columns, rows and the rule that produced them.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Report"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "403": {
            "description": "The key lacks the scope this needs."
          },
          "429": {
            "description": "More than 300 requests a minute for this key."
          }
        }
      }
    },
    "/api/v1/reports/{key}/export": {
      "get": {
        "summary": "Export a report as a file",
        "description": "Needs an API key with the \u0060reports.read\u0060 scope.",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": false,
            "description": "First day (YYYY-MM-DD, your organization\u0027s timezone). Default: 6 days before \u0060to\u0060.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "description": "Last day, inclusive. Default: today. At most 366 days per request.",
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "siteId",
            "in": "query",
            "required": false,
            "description": "Only this site.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "departmentId",
            "in": "query",
            "required": false,
            "description": "Only extensions in this department (as the directory is now).",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "description": "Call direction.",
            "schema": {
              "type": "string",
              "enum": [
                "inbound",
                "outbound",
                "internal"
              ]
            }
          },
          {
            "name": "outcome",
            "in": "query",
            "required": false,
            "description": "Call outcome.",
            "schema": {
              "type": "string",
              "enum": [
                "answered",
                "unanswered",
                "voicemail",
                "unknown"
              ]
            }
          },
          {
            "name": "category",
            "in": "query",
            "required": false,
            "description": "Type of the external number.",
            "schema": {
              "type": "string",
              "enum": [
                "internal",
                "local",
                "national",
                "mobile",
                "international",
                "toll_free",
                "premium",
                "withheld",
                "unknown"
              ]
            }
          },
          {
            "name": "extension",
            "in": "query",
            "required": false,
            "description": "Extension number.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "number",
            "in": "query",
            "required": false,
            "description": "Part of the external number (digits).",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "afterHours",
            "in": "query",
            "required": false,
            "description": "Only calls outside (true) or inside (false) working hours.",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "minTalk",
            "in": "query",
            "required": false,
            "description": "Minimum talk time in seconds.",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Report key."
          },
          {
            "name": "format",
            "in": "query",
            "required": false,
            "description": "File format.",
            "schema": {
              "type": "string",
              "enum": [
                "csv",
                "xlsx",
                "pdf"
              ]
            }
          },
          {
            "name": "lang",
            "in": "query",
            "required": false,
            "description": "Language of labels.",
            "schema": {
              "type": "string",
              "enum": [
                "en",
                "ar"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The file (CSV is UTF-8 with BOM).",
            "content": {
              "application/octet-stream": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "403": {
            "description": "The key lacks the scope this needs."
          },
          "429": {
            "description": "More than 300 requests a minute for this key."
          }
        }
      }
    },
    "/api/v1/wallboard": {
      "get": {
        "summary": "Today so far (updates as calls end)",
        "description": "Needs an API key with the \u0060reports.read\u0060 scope.",
        "parameters": [
          {
            "name": "siteId",
            "in": "query",
            "required": false,
            "description": "Only this site.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Today\u0027s totals, missed calls not yet called back, latest calls.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key."
          },
          "403": {
            "description": "The key lacks the scope this needs."
          },
          "429": {
            "description": "More than 300 requests a minute for this key."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "An API key starting with tzk_."
      }
    },
    "schemas": {
      "CallPage": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Call"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as \u0060cursor\u0060 for the next page; null on the last page."
          },
          "masked": {
            "type": "boolean"
          }
        }
      },
      "Call": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "startUtc": {
            "type": "string",
            "format": "date-time"
          },
          "startLocal": {
            "type": "string"
          },
          "siteId": {
            "type": "string",
            "format": "uuid"
          },
          "siteName": {
            "type": "string"
          },
          "direction": {
            "type": "string",
            "enum": [
              "inbound",
              "outbound",
              "internal"
            ]
          },
          "outcome": {
            "type": "string",
            "enum": [
              "answered",
              "unanswered",
              "voicemail",
              "unknown"
            ]
          },
          "extension": {
            "type": "string"
          },
          "extensionName": {
            "type": "string"
          },
          "number": {
            "type": "string"
          },
          "contact": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "region": {
            "type": "string"
          },
          "ringSeconds": {
            "type": "integer"
          },
          "talkSeconds": {
            "type": "integer"
          },
          "holdSeconds": {
            "type": "integer"
          },
          "segments": {
            "type": "integer"
          },
          "afterHours": {
            "type": "boolean"
          },
          "trunk": {
            "type": "string"
          }
        }
      },
      "Report": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "titleEn": {
            "type": "string"
          },
          "titleAr": {
            "type": "string"
          },
          "definitionEn": {
            "type": "string"
          },
          "definitionAr": {
            "type": "string"
          },
          "columns": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "key": {
                  "type": "string"
                },
                "labelEn": {
                  "type": "string"
                },
                "labelAr": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                }
              }
            }
          },
          "rows": {
            "type": "array",
            "items": {
              "type": "array"
            },
            "description": "Values in column order."
          },
          "totals": {
            "type": [
              "array",
              "null"
            ]
          },
          "truncated": {
            "type": "boolean"
          }
        }
      }
    }
  }
}