{
 "openapi": "3.1.0",
 "info": {
  "title": "Etisalna PBX API",
  "version": "v2",
  "description": "The **Etisalna PBX API** lets your own systems (CRM, ERP, website, mobile app, scripts) work with your company's phone system on the Etisalna cloud PBX: read extensions, queues and call records, place calls, log agents in and out of queues, send WhatsApp messages and SMS, and more.\n\n<div dir=\"rtl\" lang=\"ar\" style=\"border-inline-start:3px solid #2f6bff;padding:10px 14px;background:rgba(47,107,255,.06);border-radius:6px\">\n\n**بالعربي:** هذه الواجهة البرمجية تربط أنظمتك (CRM، ERP، موقعك، تطبيقك) بسنترال اتصالنا السحابي: قراءة التحويلات والطوابير وسجل المكالمات، إجراء المكالمات، تسجيل الموظفين في الطوابير، وإرسال رسائل واتساب و SMS. للحصول على مفتاح API تواصل مع دعم اتصالنا.\n\n</div>\n\n## Base URL\n\n```\nhttps://voice2.etisalna.com/api/v2\n```\n\nAll requests use HTTPS. Request and response bodies are JSON unless an endpoint says otherwise (file uploads use `multipart/form-data`).\n\n## Authentication\n\nEvery request carries your API key in the `app-key` header:\n\n```bash\ncurl https://voice2.etisalna.com/api/v2/extensions \\\n  -H \"app-key: YOUR_API_KEY\"\n```\n\n- **Getting a key:** API keys are issued by Etisalna support for your company account. Contact support from [etisalna.sa](https://etisalna.sa/contact.php) and tell us what you will connect.\n- **Scope:** a key belongs to one company (tenant) and only sees and changes that company's data.\n- **Keep it secret:** use the key from your server, never in a web page or a mobile app that users can inspect. If a key leaks, ask support to disable it and issue a new one.\n\nA missing, wrong or disabled key gets `401`:\n\n```json\n{ \"status\": \"declined\", \"message\": \"Access Denied\" }\n```\n\n## Responses\n\nSuccessful responses share one envelope:\n\n```json\n{\n  \"status\": \"success\",\n  \"message\": null,\n  \"data\": { \"...\": \"...\" }\n}\n```\n\nLists come back inside `data` (for example `data.result` for call records). Errors return a non-2xx HTTP status with `status` and a readable `message`.\n\n## Good to know\n\n- **Calls cost money.** `POST /core/click_to_call` and `POST /core/dialer_call` place real calls on your lines and use your balance. Test with your own numbers.\n- **Changes are live.** Creating, editing or deleting queues, devices, codes and other settings changes your PBX immediately for your users.\n- **IDs** in paths (`{id}`, `{device_id}` …) are the numeric IDs returned by the list endpoints.\n- **Time** values in call records are given both as text (`calldate`) and as a Unix timestamp (`calldate_ts`).\n\n## Support\n\nQuestions, a new key, or an endpoint you need that is not listed here: contact [Etisalna support](https://etisalna.sa/contact.php).\n",
  "contact": {
   "name": "Etisalna support",
   "url": "https://etisalna.sa/contact.php"
  }
 },
 "servers": [
  {
   "url": "https://voice2.etisalna.com/api/v2",
   "description": "Etisalna cloud PBX (voice2)"
  }
 ],
 "security": [
  {
   "appKey": []
  }
 ],
 "tags": [
  {
   "name": "Account Codes",
   "description": "Set of endpoints to manage the Account Codes."
  },
  {
   "name": "Authorization Codes",
   "description": "Set of endpoints to manage Authorization Codes."
  },
  {
   "name": "AI API Keys"
  },
  {
   "name": "Core",
   "description": "Place calls from your systems: click-to-call (ring an extension, then the number) and dialer calls (connect a number to a PBX destination such as a queue or IVR).\n\n> **These endpoints place real calls** and use your call balance."
  },
  {
   "name": "Conferences"
  },
  {
   "name": "Classes of Services",
   "description": "Contains all the actions/request that can be performed to the classes of services"
  },
  {
   "name": "Customer Codes",
   "description": "Set of endpoints to manage the Customer Codes."
  },
  {
   "name": "CDR",
   "description": "Call detail records of your company: who called whom, when, how long, and the result."
  },
  {
   "name": "Devices",
   "description": "Phones and softphones (including the WebPhone) and their queue membership: log an agent in or out of queues, pause and unpause."
  },
  {
   "name": "Device Profiles",
   "description": "It containts all the available requests for the module \"Device Profiles\"."
  },
  {
   "name": "Destinations"
  },
  {
   "name": "Extensions",
   "description": "The current collection shows all the methods available to get or put extensions information."
  },
  {
   "name": "Outbound Routes"
  },
  {
   "name": "Parking Lots"
  },
  {
   "name": "Phone Books"
  },
  {
   "name": "Queues",
   "description": "List of actions available to retrieve, create and edit queues.\n\nAfter creating, updating, or deleting a queue, you have to execute the \"**apply_changes**\" endpoint from the tenants' collection; this is essential to generate the configuration files, dial-plan, and others for Asterisk.\n\nThe outbound queues are only available through the API, which means that they cannot be modified through the Etisalna PBX GUI. The outbound queues are for the Dialer add-on only."
  },
  {
   "name": "Route Selections",
   "description": "The route selections module allows you to group outbound routes to assign them to an existing class of service or share them with a tenant.\n\nThe route selections are also known as **outbound profiles**. In the calls routing tab on the tenants' module, you will see a field labeled \"**Outbound Profiles**;\" this field refers to the route selection items."
  },
  {
   "name": "Roles",
   "description": "List of endpoints to manage roles on Etisalna PBX."
  },
  {
   "name": "SMS",
   "description": "Send SMS from third-party applications using the Etisalna PBX SMS module."
  },
  {
   "name": "Trunks"
  },
  {
   "name": "Users",
   "description": "Endpoints to manage Etisalna PBX's users"
  },
  {
   "name": "Virtual Faxes",
   "description": "Set of methods to retrieve Virtual Faxes' informaion. Also, it is possible sending faxes."
  },
  {
   "name": "Voicemail",
   "description": "Manage voicemail messages. Besides `DELETE`, the same address accepts the custom HTTP method `LISTENED` to mark a message as listened."
  },
  {
   "name": "Whatsapp",
   "description": "Send WhatsApp messages and media through the WhatsApp connector of your PBX, and download media of incoming messages."
  }
 ],
 "paths": {
  "/account_codes": {
   "get": {
    "tags": [
     "Account Codes"
    ],
    "summary": "List account codes",
    "description": "This endpoint retrieves all the account codes assigned to the extensions.\n\n#### Request\n\nNo request body is required for this GET request.",
    "operationId": "get_account_codes",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_all_account_codes": {
          "summary": "200 - All Account Codes",
          "value": {
           "status": "success",
           "message": null,
           "data": [
            "100",
            "200"
           ]
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "array",
           "items": {
            "type": "string"
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/auth_codes": {
   "get": {
    "tags": [
     "Authorization Codes"
    ],
    "summary": "List authorization codes",
    "description": "This endpoint retrieves a list of authorization codes.\n\n**Request Body:**\nThis request does not require a request body.\n\n**Response:**\n\n- `status` (string): The status of the response.\n\n- `message` (string): A message related to the response.\n\n- `data` (array): An array containing the following information for each authorization codes:\n\n- `id` (integer): The ID of the authorization codes.\n\n- `code` (string): The authentication code.\n\n- `alias` (string): An alias for the authorization codes.\n\n- `description` (string): A description of the authorization codes.\n\n- `cos_id` (integer): The ID of the COS (Class of Service) associated with the authorization codes.\n\n- `enabled` (boolean): Indicates whether the authorization codes is enabled or not.",
    "operationId": "get_auth_codes",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_all_auth_codes": {
          "summary": "200 - All Auth Codes",
          "value": {
           "status": "success",
           "message": null,
           "data": [
            {
             "id": 1,
             "code": "1212546",
             "alias": "Boss",
             "description": "Boss Calls",
             "cos_id": 1,
             "enabled": true
            }
           ]
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "integer"
             },
             "code": {
              "type": "string"
             },
             "alias": {
              "type": "string"
             },
             "description": {
              "type": "string"
             },
             "cos_id": {
              "type": "integer"
             },
             "enabled": {
              "type": "boolean"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   },
   "post": {
    "tags": [
     "Authorization Codes"
    ],
    "summary": "Create authorization code",
    "description": "This endpoint allows the creation of authorization codes.\n\n#### Request Body\n\n- `code` (string, required): The authorization code.\n\n- `alias` (string, required): An alias for the authorization code.\n\n- `description` (string, required): A description of the purpose of the authorization code.\n\n- `cos_id` (integer, required): The ID of the associated class of service.\n\n- `enabled` (boolean, required): Indicates whether the authorization code is enabled.\n\n#### Response\n\nThe response will be a JSON object with the following schema:\n\n```\n{\n  \"type\": \"object\",\n  \"properties\": {\n    \"status\": {\n      \"type\": \"string\"\n    },\n    \"message\": {\n      \"type\": \"string\"\n    },\n    \"data\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"id\": {\n          \"type\": \"string\"\n        },\n        \"code\": {\n          \"type\": \"string\"\n        },\n        \"alias\": {\n          \"type\": \"string\"\n        },\n        \"description\": {\n          \"type\": \"string\"\n        },\n        \"cos_id\": {\n          \"type\": \"integer\"\n        },\n        \"enabled\": {\n          \"type\": \"boolean\"\n        }\n      }\n    }\n  }\n}\n```",
    "operationId": "post_auth_codes",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "code": {
          "type": "string"
         },
         "alias": {
          "type": "string"
         },
         "description": {
          "type": "string"
         },
         "cos_id": {
          "type": "integer"
         },
         "enabled": {
          "type": "boolean"
         }
        }
       },
       "example": {
        "code": "9898",
        "alias": "sales",
        "description": "Sales Team",
        "cos_id": 1,
        "enabled": false
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_auth_code_created": {
          "summary": "200 - Auth Code Created",
          "value": {
           "status": "success",
           "message": "The data has been added to the database",
           "data": {
            "id": "2",
            "code": "9898",
            "alias": "sales",
            "description": "Sales Team",
            "cos_id": 1,
            "enabled": false
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "id": {
             "type": "string"
            },
            "code": {
             "type": "string"
            },
            "alias": {
             "type": "string"
            },
            "description": {
             "type": "string"
            },
            "cos_id": {
             "type": "integer"
            },
            "enabled": {
             "type": "boolean"
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "examples": {
         "400_invalid_request": {
          "summary": "400 - Invalid Request",
          "value": {
           "status": "validation",
           "message": "Alias is required.",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/auth_codes/{id}": {
   "get": {
    "tags": [
     "Authorization Codes"
    ],
    "summary": "Get authorization code",
    "description": "This endpoint retrieves the details of a specific authorization code.\n\n#### Request\n\nNo request body is required for this request.\n\n- Path parameter:\n\n- `id` (number): The ID of the authorization code to retrieve.\n\n#### Response\n\nThe response will be a JSON object with the following schema:\n\n```\n{\n  \"type\": \"object\",\n  \"properties\": {\n    \"status\": {\n      \"type\": \"string\"\n    },\n    \"message\": {\n      \"type\": \"null\"\n    },\n    \"data\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"id\": {\n          \"type\": \"number\"\n        },\n        \"code\": {\n          \"type\": \"string\"\n        },\n        \"alias\": {\n          \"type\": \"string\"\n        },\n        \"description\": {\n          \"type\": \"string\"\n        },\n        \"cos_id\": {\n          \"type\": \"number\"\n        },\n        \"enabled\": {\n          \"type\": \"boolean\"\n        }\n      }\n    }\n  }\n}\n```\n\nThe response will contain the status, message (if any), and the details of the authentication code including its ID, code, alias, description, cos_id, and enabled status.",
    "operationId": "get_auth_codes_id",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "Record ID"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_retrieve_single_auth_code": {
          "summary": "200 - Retrieve Single Auth Code",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "id": 1,
            "code": "1212546",
            "alias": "Boss",
            "description": "Boss Calls",
            "cos_id": 1,
            "enabled": true
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "object",
           "properties": {
            "id": {
             "type": "integer"
            },
            "code": {
             "type": "string"
            },
            "alias": {
             "type": "string"
            },
            "description": {
             "type": "string"
            },
            "cos_id": {
             "type": "integer"
            },
            "enabled": {
             "type": "boolean"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "examples": {
         "404_not_found": {
          "summary": "404 - Not Found",
          "value": {
           "status": "not_found",
           "message": "The requested authorization code doesn't exists",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    }
   },
   "put": {
    "tags": [
     "Authorization Codes"
    ],
    "summary": "Update authorization code",
    "description": "This endpoint allows the client to update an authorization code with the provided details.\n\n#### Request Body\n\n- `code` (string): The updated authorization code.\n\n- `alias` (string): The alias for the authorization code.\n\n- `description` (string): A description for the authorization code.\n\n- `cos_id` (number): The ID of the associated COS.\n\n- `enabled` (boolean): Indicates whether the authorization code is enabled.\n\n#### Response\n\nThe response is a JSON object with the following schema:\n\n```\n{\n  \"type\": \"object\",\n  \"properties\": {\n    \"status\": {\n      \"type\": \"string\"\n    },\n    \"message\": {\n      \"type\": \"string\"\n    },\n    \"data\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"id\": {\n          \"type\": \"number\"\n        },\n        \"code\": {\n          \"type\": \"string\"\n        },\n        \"alias\": {\n          \"type\": \"string\"\n        },\n        \"description\": {\n          \"type\": \"string\"\n        },\n        \"cos_id\": {\n          \"type\": \"number\"\n        },\n        \"enabled\": {\n          \"type\": \"boolean\"\n        }\n      }\n    }\n  }\n}\n```",
    "operationId": "put_auth_codes_id",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "Record ID"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "code": {
          "type": "string"
         },
         "alias": {
          "type": "string"
         },
         "description": {
          "type": "string"
         },
         "cos_id": {
          "type": "integer"
         },
         "enabled": {
          "type": "boolean"
         }
        }
       },
       "example": {
        "code": "9898",
        "alias": "sales",
        "description": "Sales Team",
        "cos_id": 1,
        "enabled": true
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_auth_code_updated": {
          "summary": "200 - Auth Code Updated",
          "value": {
           "status": "success",
           "message": "The data has been updated in the database",
           "data": {
            "id": 2,
            "code": "9898",
            "alias": "sales",
            "description": "Sales Team",
            "cos_id": 1,
            "enabled": true
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "id": {
             "type": "integer"
            },
            "code": {
             "type": "string"
            },
            "alias": {
             "type": "string"
            },
            "description": {
             "type": "string"
            },
            "cos_id": {
             "type": "integer"
            },
            "enabled": {
             "type": "boolean"
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "examples": {
         "400_invalid_request": {
          "summary": "400 - Invalid Request",
          "value": {
           "status": "validation",
           "message": "The given Class of Services is invalid!",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   },
   "patch": {
    "tags": [
     "Authorization Codes"
    ],
    "summary": "Change fields of an authorization code",
    "description": "This endpoint is used to update specific fields of a specific authorization code.\n\n#### Response\n\n- `status` (string): The status of the response.\n\n- `message` (string): A message related to the response status.\n\n- `data` (object): An object containing the updated details of the authorization code.\n\n- `id` (integer): The ID of the authorization code.\n\n- `code` (string): The authorization code.\n\n- `alias` (string): The alias of the authorization code.\n\n- `description` (string): The updated description of the authorization code.\n\n- `cos_id` (integer): The ID of the associated COS.\n\n- `enabled` (boolean): The updated status of the authorization code.",
    "operationId": "patch_auth_codes_id",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "Record ID"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "description": {
          "type": "string"
         },
         "enabled": {
          "type": "boolean"
         }
        }
       },
       "example": {
        "description": "Sales",
        "enabled": true
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_auth_code_updated": {
          "summary": "200 - Auth Code Updated",
          "value": {
           "status": "success",
           "message": "The data has been updated in the database",
           "data": {
            "id": 2,
            "code": "9898",
            "alias": "sales",
            "description": "Sales",
            "cos_id": 1,
            "enabled": true
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "id": {
             "type": "integer"
            },
            "code": {
             "type": "string"
            },
            "alias": {
             "type": "string"
            },
            "description": {
             "type": "string"
            },
            "cos_id": {
             "type": "integer"
            },
            "enabled": {
             "type": "boolean"
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "examples": {
         "400_invalid_parameters": {
          "summary": "400 - Invalid Parameters",
          "value": {
           "status": "validation",
           "message": "It looks like you didn't provide any valid information to update. Please double-check and send the necessary details.",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   },
   "delete": {
    "tags": [
     "Authorization Codes"
    ],
    "summary": "Delete authorization code",
    "description": "This API endpoint sends an HTTP DELETE request to delete a specific authorization code.\n\n#### Request Body\n\nThis request does not require a request body.\n\n#### Response\n\nThe response will not contain a body, but will include a status code to indicate the success or failure of the deletion operation.",
    "operationId": "delete_auth_codes_id",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "Record ID"
     }
    ],
    "responses": {
     "204": {
      "description": "No Content",
      "content": {
       "application/json": {
        "examples": {
         "204_item_removed": {
          "summary": "204 - Item Removed",
          "value": ""
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "examples": {
         "404_not_found": {
          "summary": "404 - Not Found",
          "value": {
           "status": "not_found",
           "message": "The requested item doesn't exists",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/ai_api_keys": {
   "get": {
    "tags": [
     "AI API Keys"
    ],
    "summary": "List AI API keys",
    "description": "",
    "operationId": "get_ai_api_keys",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_all_api_keys": {
          "summary": "200 - All API Keys",
          "value": {
           "status": "success",
           "message": null,
           "data": [
            {
             "id": 1,
             "description": "OpenAI",
             "key": "fk-c3dba5996ad348c99952c676c6b12345"
            }
           ]
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "integer"
             },
             "description": {
              "type": "string"
             },
             "key": {
              "type": "string"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   },
   "post": {
    "tags": [
     "AI API Keys"
    ],
    "summary": "Create AI API key",
    "description": "",
    "operationId": "post_ai_api_keys",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "description": {
          "type": "string"
         },
         "key": {
          "type": "string"
         }
        }
       },
       "example": {
        "description": "API Demo",
        "key": "fk-v0987654321pbx"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_item_created": {
          "summary": "200 - Item Created",
          "value": {
           "status": "success",
           "message": "The data has been added to the database",
           "data": {
            "id": "2",
            "description": "API Demo",
            "key": "fk-v0987654321pbx"
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "id": {
             "type": "string"
            },
            "description": {
             "type": "string"
            },
            "key": {
             "type": "string"
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "examples": {
         "400_invalid_request": {
          "summary": "400 - Invalid Request",
          "value": {
           "status": "validation",
           "message": "The \"API Key\" must be unique.",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/ai_api_keys/{id}": {
   "get": {
    "tags": [
     "AI API Keys"
    ],
    "summary": "Get AI API key",
    "description": "",
    "operationId": "get_ai_api_keys_id",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "Record ID"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_retrieve_single_api_key": {
          "summary": "200 - Retrieve Single API Key",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "id": 1,
            "description": "OpenAI",
            "key": "fk-c3dba5996ad348c99952c676c6b12345"
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "object",
           "properties": {
            "id": {
             "type": "integer"
            },
            "description": {
             "type": "string"
            },
            "key": {
             "type": "string"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "examples": {
         "404_not_found": {
          "summary": "404 - Not Found",
          "value": {
           "status": "not_found",
           "message": "The requested item doesn't exists",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    }
   },
   "put": {
    "tags": [
     "AI API Keys"
    ],
    "summary": "Update AI API key",
    "description": "",
    "operationId": "put_ai_api_keys_id",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "Record ID"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "description": {
          "type": "string"
         },
         "key": {
          "type": "string"
         }
        }
       },
       "example": {
        "description": "Postman Demo",
        "key": "fk-vital0987654321pbx"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_item_updated": {
          "summary": "200 - Item Updated",
          "value": {
           "status": "success",
           "message": "The data has been updated in the database",
           "data": {
            "id": 2,
            "description": "Postman Demo",
            "key": "fk-vital0987654321pbx"
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "id": {
             "type": "integer"
            },
            "description": {
             "type": "string"
            },
            "key": {
             "type": "string"
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "examples": {
         "400_bad_request": {
          "summary": "400 - Bad Request",
          "value": {
           "status": "validation",
           "message": "The field \"Description\" is required.",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   },
   "delete": {
    "tags": [
     "AI API Keys"
    ],
    "summary": "Delete AI API key",
    "description": "",
    "operationId": "delete_ai_api_keys_id",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "Record ID"
     }
    ],
    "responses": {
     "204": {
      "description": "No Content",
      "content": {
       "application/json": {
        "examples": {
         "204_item_deleted": {
          "summary": "204 - Item Deleted",
          "value": ""
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "examples": {
         "400_validations": {
          "summary": "400 - Validations",
          "value": {
           "status": "validation",
           "message": "This API Key item cannot be deleted because of being used by the following AI Assistants: \"Nova, PBX_ASSISTANT_1733416356\".",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/core/click_to_call": {
   "post": {
    "tags": [
     "Core"
    ],
    "summary": "Click-to-call",
    "description": "This endpoint performs or originates a call with given numbers (caller and callee). If you want to use a specific class of service, you can use the Classes of Services endpoints to list the available CoS in a tenant.\n\nBear in mind that when the API endpoint queues a call, it might fail due to an invalid caller or callee number. The API has no way to know if the Asterisk server placed the call or not.\n\n| **Option Name** | **Type** | **Default Value** | **Description** |\n| --- | --- | --- | --- |\n| **caller** | String |  | It represents the number that originates the call. Usually, this parameter would contain an extension number. Nonetheless, you can provide a queue number, conference number, or even an external number. Bear in mind that if you don't supply an extension number, you must provide a valid class of service. |\n| **callee** | String |  | It represents the number that receives the call. It can be an internal or external number. If you provide an external number, make sure the format fulfills the outbound routes patterns. |\n| **cos_id** | Integer |  | A valid ID of a class of service to be utilized for routing the call. This parameter is optional if the caller is an extension number. |\n| **cid_name** | String | Etisalna PBX: Click to Call | Optional parameter that allows you to customize the Caller ID name shown to the caller. |\n| **cid_number** | String | Callee Number | Optional parameter that allows you to customize the Caller ID number shown to the caller. |\n| **variables** | Object |  | List of variables to be part of the call channels. The reserved variable CONTEXT allows you to define a custom context to process your Click to Call calls. |",
    "operationId": "post_core_click_to_call",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "caller": {
          "type": "integer"
         },
         "callee": {
          "type": "integer"
         },
         "cos_id": {
          "type": "integer"
         },
         "cid_name": {
          "type": "string"
         },
         "cid_number": {
          "type": "integer"
         },
         "variables": {
          "type": "object",
          "properties": {
           "FID_CODE": {
            "type": "integer"
           },
           "NO_POST_SERVICES": {
            "type": "string"
           }
          }
         }
        }
       },
       "example": {
        "caller": 0,
        "callee": 7545550884,
        "cos_id": 1,
        "cid_name": "Etisalna PBX Cloud",
        "cid_number": 7545550884,
        "variables": {
         "FID_CODE": 12345,
         "NO_POST_SERVICES": "yes"
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_call_queued": {
          "summary": "200 - Call Queued",
          "value": {
           "status": "success",
           "message": "Call queued",
           "data": {
            "caller": 100,
            "callee": 13055605776,
            "cos_id": 1,
            "cid_name": "My PBX",
            "cid_number": 13055605776,
            "variables": {
             "X-APP": "Postman",
             "X-CAMPAIGN": "sales"
            },
            "tenant": "713b0732d7b683af"
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "caller": {
             "type": "integer"
            },
            "callee": {
             "type": "integer"
            },
            "cos_id": {
             "type": "integer"
            },
            "cid_name": {
             "type": "string"
            },
            "cid_number": {
             "type": "integer"
            },
            "variables": {
             "type": "object",
             "properties": {
              "X-APP": {
               "type": "string"
              },
              "X-CAMPAIGN": {
               "type": "string"
              }
             }
            },
            "tenant": {
             "type": "string"
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "examples": {
         "400_invalid_data": {
          "summary": "400 - Invalid Data",
          "value": {
           "status": "validation",
           "message": "You have not provided a valid class of service ID",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/core/dialer_call": {
   "post": {
    "tags": [
     "Core"
    ],
    "summary": "Dialer call (number to a PBX destination)",
    "description": "It facilitates the initiation of a call connection between an external or internal number and a designated PBX destination. Specifically designed for outbound campaigns, this feature proves invaluable for delivering notifications, conducting surveys, and other communication initiatives.\n\n#### Parameters\n\n| Parameter | **Type** | Description |\n| --- | --- | --- |\n| number | string | The number to be called at first. |\n| cos_id | int | The Class of Service to use for placing the call. |\n| destination_category_id | int | The Destination Category. It represents the module or application to which a call will be routed upon the recipient's answer to the dialed number. You can obtain the list of destination category using this enpoint. |\n| destination_id | int | The available destination for the selected destination category. These are the items created in the modules associated with the selected category. You can obtain them using this endpoint. |\n| cid_number | string | Optional parameter to define a custom caller id number. |\n| cid_name | string | Optional parameter to define a custom caller id name. |\n| timeout | int | Optinal parameter to define how long to wait for call to be answered (in secs.). |\n\n It's crucial to ensure seamless integration and successful call routing through this API endpoint that the specified Outbound Routes within the corresponding Class of Service align with the number format transmitted in the API request. The Outbound Routes configuration serves as a set of rules that dictate how calls are directed based on the dialed number patterns. Therefore, maintaining consistency between the number format provided in the API request and the configured Outbound Routes is paramount. This meticulous alignment guarantees accurate call handling and enhances the effectiveness of the API in facilitating outbound communication campaigns.",
    "operationId": "post_core_dialer_call",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "number": {
          "type": "integer"
         },
         "cos_id": {
          "type": "integer"
         },
         "destination_category_id": {
          "type": "integer"
         },
         "destination_id": {
          "type": "integer"
         },
         "cid_number": {
          "type": "integer"
         },
         "cid_name": {
          "type": "string"
         }
        }
       },
       "example": {
        "number": 168080,
        "cos_id": 1,
        "destination_category_id": 18,
        "destination_id": 3,
        "cid_number": 13051113333,
        "cid_name": "Fl, USA"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_call_queued": {
          "summary": "200 - Call Queued",
          "value": {
           "status": "success",
           "message": "Originate successfully queued",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "examples": {
         "400_invalid_parameters": {
          "summary": "400 - Invalid Parameters",
          "value": {
           "status": "validation",
           "message": "You have not provided a valid class of service ID",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "503": {
      "description": "Service Unavailable",
      "content": {
       "application/json": {
        "examples": {
         "503_call_failed": {
          "summary": "503 - Call Failed",
          "value": {
           "status": "error",
           "message": "Originate failed",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/conferences/{id}": {
   "get": {
    "tags": [
     "Conferences"
    ],
    "summary": "Get conference",
    "description": "Get info about specific conference room",
    "operationId": "get_conferences_id",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "Record ID"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_confrence_retrieved": {
          "summary": "200 - Confrence retrieved",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "conference_id": 1,
            "extension": "600",
            "description": "My Conferences",
            "class_of_service_id": 1,
            "userpin": null,
            "adminpin": null,
            "max_members": null,
            "video_mode": "sfu",
            "language": "en",
            "record_conference": true,
            "announcement_id": 1,
            "music_group_id": 1,
            "music_on_hold_when_empty": true,
            "startmuted": false,
            "quiet": false,
            "announce_user_count_all": null,
            "announce_user_count": false,
            "announce_only_user": true,
            "wait_marked": false,
            "end_marked": false,
            "dsp_drop_silence": true,
            "talk_detection_events": true,
            "announce_join_leave": true,
            "allow_to_invite": true,
            "tenant_id": 1
           }
          }
         },
         "conference_id": {
          "summary": "/conference/{id}",
          "value": {
           "status": "success",
           "data": {
            "conference_id": 1,
            "extension": "600",
            "description": "My Conferences",
            "class_of_service_id": 1,
            "userpin": null,
            "adminpin": null,
            "max_members": null,
            "video_mode": "none",
            "language": "en",
            "record_conference": true,
            "announcement_id": 1,
            "music_group_id": 1,
            "music_on_hold_when_empty": true,
            "startmuted": false,
            "quiet": false,
            "announce_user_count_all": null,
            "announce_user_count": false,
            "announce_only_user": true,
            "wait_marked": false,
            "end_marked": false,
            "dsp_drop_silence": true,
            "talk_detection_events": true,
            "announce_join_leave": true,
            "allow_to_invite": true,
            "tenant_id": 1
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "object",
           "properties": {
            "conference_id": {
             "type": "integer"
            },
            "extension": {
             "type": "string"
            },
            "description": {
             "type": "string"
            },
            "class_of_service_id": {
             "type": "integer"
            },
            "userpin": {},
            "adminpin": {},
            "max_members": {},
            "video_mode": {
             "type": "string"
            },
            "language": {
             "type": "string"
            },
            "record_conference": {
             "type": "boolean"
            },
            "announcement_id": {
             "type": "integer"
            },
            "music_group_id": {
             "type": "integer"
            },
            "music_on_hold_when_empty": {
             "type": "boolean"
            },
            "startmuted": {
             "type": "boolean"
            },
            "quiet": {
             "type": "boolean"
            },
            "announce_user_count_all": {},
            "announce_user_count": {
             "type": "boolean"
            },
            "announce_only_user": {
             "type": "boolean"
            },
            "wait_marked": {
             "type": "boolean"
            },
            "end_marked": {
             "type": "boolean"
            },
            "dsp_drop_silence": {
             "type": "boolean"
            },
            "talk_detection_events": {
             "type": "boolean"
            },
            "announce_join_leave": {
             "type": "boolean"
            },
            "allow_to_invite": {
             "type": "boolean"
            },
            "tenant_id": {
             "type": "integer"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "examples": {
         "404_conference_not_found": {
          "summary": "404 - Conference not found",
          "value": {
           "status": "not_found",
           "message": "The requested conference doesn't exists",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/conferences": {
   "get": {
    "tags": [
     "Conferences"
    ],
    "summary": "List conferences",
    "description": "Get all PBX conference rooms",
    "operationId": "get_conferences",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_all_conferences_retrieved": {
          "summary": "200 - All conferences retrieved",
          "value": {
           "status": "success",
           "message": null,
           "data": [
            {
             "conference_id": 1,
             "extension": "600",
             "description": "My Conferences",
             "class_of_service_id": 1,
             "userpin": null,
             "adminpin": null,
             "max_members": null,
             "video_mode": "sfu",
             "language": "en",
             "record_conference": true,
             "announcement_id": 1,
             "music_group_id": 1,
             "music_on_hold_when_empty": true,
             "startmuted": false,
             "quiet": false,
             "announce_user_count_all": null,
             "announce_user_count": false,
             "announce_only_user": true,
             "wait_marked": false,
             "end_marked": false,
             "dsp_drop_silence": true,
             "talk_detection_events": true,
             "announce_join_leave": true,
             "allow_to_invite": true,
             "tenant_id": 1
            },
            {
             "conference_id": 2,
             "extension": "601",
             "description": "Conferece Demo",
             "class_of_service_id": 1,
             "userpin": null,
             "adminpin": null,
             "max_members": null,
             "video_mode": "none",
             "language": "es_NI",
             "record_conference": true,
             "announcement_id": 1,
             "music_group_id": 1,
             "music_on_hold_when_empty": true,
             "startmuted": false,
             "quiet": false,
             "announce_user_count_all": null,
             "announce_user_count": false,
             "announce_only_user": true,
             "wait_marked": false,
             "end_marked": false,
             "dsp_drop_silence": true,
             "talk_detection_events": false,
             "announce_join_leave": false,
             "allow_to_invite": false,
             "tenant_id": 1
            },
            {
             "conference_id": 4,
             "extension": "700",
             "description": "Demo",
             "class_of_service_id": 1,
             "userpin": null,
             "adminpin": null,
             "max_members": null,
             "video_mode": "none",
             "language": "en",
             "record_conference": true,
             "announcement_id": 1,
             "music_group_id": 1,
             "music_on_hold_when_empty": true,
             "startmuted": false,
             "quiet": false,
             "announce_user_count_all": null,
             "announce_user_count": false,
             "announce_only_user": true,
             "wait_marked": false,
             "end_marked": false,
             "dsp_drop_silence": true,
             "talk_detection_events": false,
             "announce_join_leave": false,
             "allow_to_invite": false,
             "tenant_id": 1
            },
            {
             "conference_id": 5,
             "extension": "950",
             "description": "Parking Test",
             "class_of_service_id": 1,
             "userpin": "4321",
             "adminpin": "12345",
             "max_members": null,
             "video_mode": "none",
             "language": "en",
             "record_conference": true,
             "announcement_id": 1,
             "music_group_id": 1,
             "music_on_hold_when_empty": true,
             "startmuted": false,
             "quiet": false,
             "announce_user_count_all": null,
             "announce_user_count": false,
             "announce_only_user": true,
             "wait_marked": false,
             "end_marked": false,
             "dsp_drop_silence": true,
             "talk_detection_events": false,
             "announce_join_leave": false,
             "allow_to_invite": false,
             "tenant_id": 1
            }
           ]
          }
         },
         "conferences": {
          "summary": "/conferences",
          "value": {
           "status": "success",
           "data": [
            {
             "conference_id": 1,
             "extension": "600",
             "description": "My Conferences",
             "class_of_service_id": 1,
             "userpin": null,
             "adminpin": null,
             "max_members": null,
             "video_mode": "none",
             "language": "en",
             "record_conference": true,
             "announcement_id": 1,
             "music_group_id": 1,
             "music_on_hold_when_empty": true,
             "startmuted": false,
             "quiet": false,
             "announce_user_count_all": null,
             "announce_user_count": false,
             "announce_only_user": true,
             "wait_marked": false,
             "end_marked": false,
             "dsp_drop_silence": true,
             "talk_detection_events": true,
             "announce_join_leave": true,
             "allow_to_invite": true,
             "tenant_id": 1
            },
            {
             "conference_id": 2,
             "extension": "601",
             "description": "Conferece Demo",
             "class_of_service_id": 1,
             "userpin": null,
             "adminpin": null,
             "max_members": null,
             "video_mode": "none",
             "language": "es_NI",
             "record_conference": true,
             "announcement_id": 1,
             "music_group_id": 1,
             "music_on_hold_when_empty": true,
             "startmuted": false,
             "quiet": false,
             "announce_user_count_all": null,
             "announce_user_count": false,
             "announce_only_user": true,
             "wait_marked": false,
             "end_marked": false,
             "dsp_drop_silence": true,
             "talk_detection_events": false,
             "announce_join_leave": false,
             "allow_to_invite": false,
             "tenant_id": 1
            },
            {
             "conference_id": 4,
             "extension": "700",
             "description": "Demo",
             "class_of_service_id": 1,
             "userpin": null,
             "adminpin": null,
             "max_members": null,
             "video_mode": "none",
             "language": "en",
             "record_conference": true,
             "announcement_id": 1,
             "music_group_id": 1,
             "music_on_hold_when_empty": true,
             "startmuted": false,
             "quiet": false,
             "announce_user_count_all": null,
             "announce_user_count": false,
             "announce_only_user": true,
             "wait_marked": false,
             "end_marked": false,
             "dsp_drop_silence": true,
             "talk_detection_events": false,
             "announce_join_leave": false,
             "allow_to_invite": false,
             "tenant_id": 1
            },
            {
             "conference_id": 5,
             "extension": "950",
             "description": "Parking Test",
             "class_of_service_id": 1,
             "userpin": "4321",
             "adminpin": "12345",
             "max_members": null,
             "video_mode": "none",
             "language": "en",
             "record_conference": true,
             "announcement_id": 1,
             "music_group_id": 1,
             "music_on_hold_when_empty": true,
             "startmuted": false,
             "quiet": false,
             "announce_user_count_all": null,
             "announce_user_count": false,
             "announce_only_user": true,
             "wait_marked": false,
             "end_marked": false,
             "dsp_drop_silence": true,
             "talk_detection_events": false,
             "announce_join_leave": false,
             "allow_to_invite": false,
             "tenant_id": 1
            }
           ]
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "conference_id": {
              "type": "integer"
             },
             "extension": {
              "type": "string"
             },
             "description": {
              "type": "string"
             },
             "class_of_service_id": {
              "type": "integer"
             },
             "userpin": {},
             "adminpin": {},
             "max_members": {},
             "video_mode": {
              "type": "string"
             },
             "language": {
              "type": "string"
             },
             "record_conference": {
              "type": "boolean"
             },
             "announcement_id": {
              "type": "integer"
             },
             "music_group_id": {
              "type": "integer"
             },
             "music_on_hold_when_empty": {
              "type": "boolean"
             },
             "startmuted": {
              "type": "boolean"
             },
             "quiet": {
              "type": "boolean"
             },
             "announce_user_count_all": {},
             "announce_user_count": {
              "type": "boolean"
             },
             "announce_only_user": {
              "type": "boolean"
             },
             "wait_marked": {
              "type": "boolean"
             },
             "end_marked": {
              "type": "boolean"
             },
             "dsp_drop_silence": {
              "type": "boolean"
             },
             "talk_detection_events": {
              "type": "boolean"
             },
             "announce_join_leave": {
              "type": "boolean"
             },
             "allow_to_invite": {
              "type": "boolean"
             },
             "tenant_id": {
              "type": "integer"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/classes_of_services": {
   "get": {
    "tags": [
     "Classes of Services"
    ],
    "summary": "List classes of service",
    "description": "Retrieve all the classes of services filtered by tenant.",
    "operationId": "get_classes_of_services",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_retrieve_all": {
          "summary": "200 - Retrieve All",
          "value": {
           "status": "success",
           "message": null,
           "data": [
            {
             "class_of_service_id": 1,
             "cos": "all",
             "description": "All Permissions",
             "feature_code_category_id": null,
             "ars_id": null,
             "dialrule_id": 4,
             "private": false,
             "allowed_calls_by": null,
             "billing_app_id": null,
             "default": true,
             "tenant_id": 1
            },
            {
             "class_of_service_id": 2,
             "cos": "internal-only",
             "description": "Internal Calls Only",
             "feature_code_category_id": 1,
             "ars_id": null,
             "dialrule_id": 1,
             "private": false,
             "allowed_calls_by": null,
             "billing_app_id": null,
             "default": false,
             "tenant_id": 1
            },
            {
             "class_of_service_id": 3,
             "cos": "administration",
             "description": "Administration",
             "feature_code_category_id": 2,
             "ars_id": null,
             "dialrule_id": null,
             "private": true,
             "allowed_calls_by": "4,1",
             "billing_app_id": null,
             "default": false,
             "tenant_id": 1
            },
            {
             "class_of_service_id": 4,
             "cos": "billing",
             "description": "Billing Demo",
             "feature_code_category_id": null,
             "ars_id": null,
             "dialrule_id": null,
             "private": false,
             "allowed_calls_by": null,
             "billing_app_id": 1,
             "default": false,
             "tenant_id": 1
            },
            {
             "class_of_service_id": 5,
             "cos": "nemo",
             "description": "nemo",
             "feature_code_category_id": null,
             "ars_id": null,
             "dialrule_id": null,
             "private": false,
             "allowed_calls_by": null,
             "billing_app_id": null,
             "default": false,
             "tenant_id": 1
            },
            {
             "class_of_service_id": 14,
             "cos": "Privado",
             "description": "Privado",
             "feature_code_category_id": null,
             "ars_id": null,
             "dialrule_id": null,
             "private": false,
             "allowed_calls_by": null,
             "billing_app_id": null,
             "default": true,
             "tenant_id": 1
            },
            {
             "class_of_service_id": 17,
             "cos": "Internacional",
             "description": "Internacional",
             "feature_code_category_id": null,
             "ars_id": 10,
             "dialrule_id": null,
             "private": false,
             "allowed_calls_by": null,
             "billing_app_id": null,
             "default": false,
             "tenant_id": 1
            }
           ]
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "class_of_service_id": {
              "type": "integer"
             },
             "cos": {
              "type": "string"
             },
             "description": {
              "type": "string"
             },
             "feature_code_category_id": {},
             "ars_id": {},
             "dialrule_id": {
              "type": "integer"
             },
             "private": {
              "type": "boolean"
             },
             "allowed_calls_by": {},
             "billing_app_id": {},
             "default": {
              "type": "boolean"
             },
             "tenant_id": {
              "type": "integer"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/classes_of_services/{id}": {
   "get": {
    "tags": [
     "Classes of Services"
    ],
    "summary": "Get class of service",
    "description": "Retrieve all the classes of services filtered by tenant.",
    "operationId": "get_classes_of_services_id",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "Record ID"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_retrieve_single_cos": {
          "summary": "200 - Retrieve Single CoS",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "class_of_service_id": 1,
            "cos": "all",
            "description": "All Permissions",
            "feature_code_category_id": null,
            "ars_id": null,
            "dialrule_id": 4,
            "private": false,
            "allowed_calls_by": null,
            "billing_app_id": null,
            "default": true,
            "tenant_id": 1
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "object",
           "properties": {
            "class_of_service_id": {
             "type": "integer"
            },
            "cos": {
             "type": "string"
            },
            "description": {
             "type": "string"
            },
            "feature_code_category_id": {},
            "ars_id": {},
            "dialrule_id": {
             "type": "integer"
            },
            "private": {
             "type": "boolean"
            },
            "allowed_calls_by": {},
            "billing_app_id": {},
            "default": {
             "type": "boolean"
            },
            "tenant_id": {
             "type": "integer"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "examples": {
         "404_cos_not_found": {
          "summary": "404 - CoS not found",
          "value": {
           "status": "not_found",
           "message": "The requested class of service doesn't exists",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/customer_codes": {
   "get": {
    "tags": [
     "Customer Codes"
    ],
    "summary": "List customer codes",
    "description": "This endpoint retrieves a list of customer codes.\n\n#### Request\n\n#### HTTP Request\n\n`GET http:///api/v2/customer_codes`\n\n#### Response\n\n- `status` (string): The status of the response.\n\n- `message` (string): A message related to the response.\n\n- `data` (array):\n\n- `id` (integer): The ID of the customer code.\n\n- `code` (string): The customer code.\n\n- `description` (string): The description of the customer code.\n\n- `enabled` (boolean): Indicates whether the customer code is enabled.\n\nExample Response:\n\n```\n{\n  \"status\": \"\",\n  \"message\": null,\n  \"data\": [\n    {\n      \"id\": 0,\n      \"code\": \"\",\n      \"description\": \"\",\n      \"enabled\": true\n    }\n  ]\n}\n```",
    "operationId": "get_customer_codes",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_all_customer_codes": {
          "summary": "200 - All customer codes",
          "value": {
           "status": "success",
           "message": null,
           "data": [
            {
             "id": 1,
             "code": "8989",
             "description": "ABC",
             "enabled": true
            }
           ]
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "integer"
             },
             "code": {
              "type": "string"
             },
             "description": {
              "type": "string"
             },
             "enabled": {
              "type": "boolean"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   },
   "post": {
    "tags": [
     "Customer Codes"
    ],
    "summary": "Create customer code",
    "description": "This API endpoint allows you to create a new customer code.\n\n#### Request Body\n\n- Type: JSON\n\n- Attributes:\n\n- `code` (string, required): The customer code.\n\n- `description` (string, required): Description of the customer code.\n\n- `enabled` (boolean, required): Indicates if the customer code is enabled.\n\nExample:\n\n```\n{\n  \"code\": \"2525\",\n  \"description\": \"Evil Company\",\n  \"enabled\": true\n}\n```\n\n- Type: JSON\n\n- Attributes:\n\n- `code` (string, required): The customer code.\n\n- `description` (string, required): Description of the customer code.\n\n- `enabled` (boolean, required): Indicates if the customer code is enabled.\n\nExample:\n\n```\n{\n  \"code\": \"2525\",\n  \"description\": \"Evil Company\",\n  \"enabled\": true\n}\n```\n\n#### Response Body\n\nThe response for this request can be represented as a JSON schema:\n\n```\n{\n  \"type\": \"object\",\n  \"properties\": {\n    \"status\": {\n      \"type\": \"string\"\n    },\n    \"message\": {\n      \"type\": \"string\"\n    },\n    \"data\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"id\": {\n          \"type\": \"string\"\n        },\n        \"code\": {\n          \"type\": \"string\"\n        },\n        \"description\": {\n          \"type\": \"string\"\n        },\n        \"enabled\": {\n          \"type\": \"boolean\"\n        }\n      }\n    }\n  }\n}\n```",
    "operationId": "post_customer_codes",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "code": {
          "type": "string"
         },
         "description": {
          "type": "string"
         },
         "enabled": {
          "type": "boolean"
         }
        }
       },
       "example": {
        "code": "2525",
        "description": "Evil Company",
        "enabled": true
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_item_created": {
          "summary": "200 - Item Created",
          "value": {
           "status": "success",
           "message": "The data has been added to the database",
           "data": {
            "id": "2",
            "code": "2525",
            "description": "Evil Company",
            "enabled": true
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "id": {
             "type": "string"
            },
            "code": {
             "type": "string"
            },
            "description": {
             "type": "string"
            },
            "enabled": {
             "type": "boolean"
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "examples": {
         "400_invalid_request": {
          "summary": "400 - Invalid Request",
          "value": {
           "status": "validation",
           "message": "The provided code is already in use",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/customer_codes/{id}": {
   "get": {
    "tags": [
     "Customer Codes"
    ],
    "summary": "Get customer code",
    "description": "This endpoint retrieves the details of a specific customer code.\n\n#### Request\n\n- Method: GET\n\n- URL: `http:///api/v2/customer_codes/1`\n\n#### Response\n\nThe response for this request follows the JSON schema below:\n\n```\n{\n  \"type\": \"object\",\n  \"properties\": {\n    \"status\": { \"type\": \"string\" },\n    \"message\": { \"type\": \"null\" },\n    \"data\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"id\": { \"type\": \"integer\" },\n        \"code\": { \"type\": \"string\" },\n        \"description\": { \"type\": \"string\" },\n        \"enabled\": { \"type\": \"boolean\" }\n      }\n    }\n  }\n}\n```",
    "operationId": "get_customer_codes_id",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "Record ID"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_retrieve_single_customer_code": {
          "summary": "200 - Retrieve Single Customer Code",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "id": 1,
            "code": "8989",
            "description": "ABC",
            "enabled": true
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "object",
           "properties": {
            "id": {
             "type": "integer"
            },
            "code": {
             "type": "string"
            },
            "description": {
             "type": "string"
            },
            "enabled": {
             "type": "boolean"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "examples": {
         "404_not_found": {
          "summary": "404 - Not Found",
          "value": {
           "status": "not_found",
           "message": "The requested authorization code doesn't exists",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    }
   },
   "put": {
    "tags": [
     "Customer Codes"
    ],
    "summary": "Update customer code",
    "description": "#### Update Customer Code\n\nThis endpoint allows the client to update a specific customer code.\n\n#### Request Body\n\n- code (string, required): The code for the customer.\n\n- description (string, required): The description of the customer code.\n\n- enabled (boolean, required): Indicates whether the customer code is enabled.\n\n#### Response\n\nThe response for this request can be represented as a JSON schema:\n\n```\n{\n  \"type\": \"object\",\n  \"properties\": {\n    \"status\": {\n      \"type\": \"string\"\n    },\n    \"message\": {\n      \"type\": \"string\"\n    },\n    \"data\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"id\": {\n          \"type\": \"integer\"\n        },\n        \"code\": {\n          \"type\": \"string\"\n        },\n        \"description\": {\n          \"type\": \"string\"\n        },\n        \"enabled\": {\n          \"type\": \"boolean\"\n        }\n      }\n    }\n  }\n}\n```",
    "operationId": "put_customer_codes_id",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "Record ID"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "code": {
          "type": "string"
         },
         "description": {
          "type": "string"
         },
         "enabled": {
          "type": "boolean"
         }
        }
       },
       "example": {
        "code": "2525",
        "description": "Good Company",
        "enabled": true
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_item_updated": {
          "summary": "200 - Item Updated",
          "value": {
           "status": "success",
           "message": "The data has been updated in the database",
           "data": {
            "id": 2,
            "code": "2525",
            "description": "Good Company",
            "enabled": true
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "id": {
             "type": "integer"
            },
            "code": {
             "type": "string"
            },
            "description": {
             "type": "string"
            },
            "enabled": {
             "type": "boolean"
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "examples": {
         "400_invalid_request": {
          "summary": "400 - Invalid Request",
          "value": {
           "status": "validation",
           "message": "Customer Codes is required.",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   },
   "patch": {
    "tags": [
     "Customer Codes"
    ],
    "summary": "Change fields of a customer code",
    "description": "This endpoint allows you to update specific fields for a specific customer code.\n\n#### Response\n\nThe response will be a JSON object with the following schema:\n\n```\n{\n  \"type\": \"object\",\n  \"properties\": {\n    \"status\": {\n      \"type\": \"string\"\n    },\n    \"message\": {\n      \"type\": \"string\"\n    },\n    \"data\": {\n      \"type\": \"object\",\n      \"properties\": {\n        \"id\": {\n          \"type\": \"integer\"\n        },\n        \"code\": {\n          \"type\": \"string\"\n        },\n        \"description\": {\n          \"type\": \"string\"\n        },\n        \"enabled\": {\n          \"type\": \"boolean\"\n        }\n      }\n    }\n  }\n}\n```",
    "operationId": "patch_customer_codes_id",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "Record ID"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "description": {
          "type": "string"
         }
        }
       },
       "example": {
        "description": "ABC Corporation"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_item_updated": {
          "summary": "200 - Item Updated",
          "value": {
           "status": "success",
           "message": "The data has been updated in the database",
           "data": {
            "id": 1,
            "code": "8989",
            "description": "ABC Corporation",
            "enabled": true
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "id": {
             "type": "integer"
            },
            "code": {
             "type": "string"
            },
            "description": {
             "type": "string"
            },
            "enabled": {
             "type": "boolean"
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "examples": {
         "400_invalid_request": {
          "summary": "400 - Invalid Request",
          "value": {
           "status": "validation",
           "message": "It looks like you didn't provide any valid information to update. Please double-check and send the necessary details.",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   },
   "delete": {
    "tags": [
     "Customer Codes"
    ],
    "summary": "Delete customer code",
    "description": "This endpoint is used to delete a specific customer code.\n\n#### Request Body\n\nThis request does not require a request body.\n\n#### Response\n\nThe response will not contain a body, but will include a status code to indicate the success or failure of the deletion operation.",
    "operationId": "delete_customer_codes_id",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "Record ID"
     }
    ],
    "responses": {
     "200": {
      "description": "Success"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/cdr": {
   "get": {
    "tags": [
     "CDR"
    ],
    "summary": "List call records (CDR)",
    "description": "The **CDR Read** endpoint retrieves Call Detail Records (CDRs) from Etisalna PBX for the selected tenant. It supports **flexible filtering, sorting, and pagination options** for analyzing inbound, outbound, and internal calls.\n\nYou can filter results by date range, extensions, call type, and search across specific fields (like source, destination, or disposition).\n\n#### ⚙️ Parameters\n\n| Parameter | Example | Type | Description |\n| --- | --- | --- | --- |\n| **extensions** | `100` or `100,200` | string | Filter CDRs by **source** and **destination** numbers. If combined with `call_history=yes`, only two numbers are allowed and returns their call history. |\n| **calltype** | `1,2,3,4` | string | Filter by call type: `1` → Internal `2` → Incoming `3` → Outgoing `4` → Transit |\n| **start_date** | `2025-01-01` | string / int | Filter records **starting from this date/time**. Accepts `YYYY-MM-DD` or UNIX timestamp. Example: `\"2025-01-01 08:00\"` or `1735689600` |\n| **end_date** | `2025-10-30` | string / int | Filter records **up to this date/time**. Accepts `YYYY-MM-DD` or UNIX timestamp. |\n| **limit** | `100` | string / int | Limits number of returned rows. Supports multiple modes: – `\"100\"` → Return 100 rows. – `\"0,10\"` → DataTables-style pagination (offset,length). – `\"all=true\"` → Retrieve all data (use carefully). |\n| **page** | `1` | int | Page number when using classic pagination. Ignored if `limit` uses DataTables format. |\n| **order_by** | `calldate` | string | Field used for sorting results. Common values: `calldate`, `src`, `dst`, `duration`. |\n| **order_type** | `desc` | string | Sort order. Use `asc` or `desc`. |\n| **search** | `answered` | string | Generic keyword search. Matches values in fields defined by `search_fields`. |\n| **search_fields** | `disposition,source,destination` | string | Comma-separated field list to apply search filter against. |\n| **call_history** | `yes` | string | When set to `\"yes\"`, only two numbers should be provided in `extensions`. Returns bidirectional call history between them. |\n| **all** | `true` | boolean / string | When `\"true\"`, disables pagination and returns all records. |\n\n#### Notes\n\n- Dates support **both UNIX timestamps and human-readable formats** (`YYYY-MM-DD` or `YYYY-MM-DD HH:mm`).\n\n- If `limit` is `\"0,10\"` format, pagination uses **DataTables mode**.\n\n- ⚠️ Setting `\"all\":\"true\"` overrides pagination limits — use cautiously with large datasets.\n\n- Search is **case-insensitive** and works across multiple fields defined in `search_fields`.\n\n- `recording_url` is automatically generated if a recording file is found.\n\n- `vm_files` lists related voicemail recordings if available.\n\n- Calls marked as `NO ANSWER` but linked to another call with `ANSWERED` in the same `linkedid` are automatically displayed as \"**Answered Elsewhere.\"**\n\n- If `start_date` and `end_date` are missing, the API filters CDRs from the **current month (30-day range)**.",
    "operationId": "get_cdr",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "get_cdr": {
          "summary": "Get CDR",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "result": [
             {
              "cdr_id": 544,
              "calldate_ts": 1761695217,
              "calldate": "2025-10-28 23:46:57",
              "accountcode": "",
              "source": "4722571902",
              "destination": "101",
              "duration": 11,
              "billsec": 9,
              "channel": "Local/101@queue-call-to-agents-00000009;2",
              "dstchannel": "PJSIP/101-0000000e",
              "lastapp": "Dial",
              "lastdata": "PJSIP/101/sip:101@192.168.0.10:51701,30,kKtrb(sub-before-connecting-call^s^1(82",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761695217.36",
              "linkedid": "1761695216.32",
              "calltype": "2",
              "peeraccount": "100",
              "trunk": 1,
              "recfile": "/var/spool/asterisk/monitor/2025/10/28/174656-IN-NONE-4722571902-168090-1761695216.32.wav",
              "disposition": "ANSWERED",
              "tenant": "mycompany",
              "recording_url": "https://dummy.pbx.com/vrecordings/2025/10/28/174656-IN-NONE-4722571902-168090-1761695216.32.wav",
              "vm_files": []
             },
             {
              "cdr_id": 543,
              "calldate_ts": 1761695217,
              "calldate": "2025-10-28 23:46:57",
              "accountcode": "",
              "source": "4722571902",
              "destination": "100",
              "duration": 2,
              "billsec": 0,
              "channel": "Local/100@queue-call-to-agents-00000008;2",
              "dstchannel": "PJSIP/100-0000000f",
              "lastapp": "Dial",
              "lastdata": "PJSIP/100/sip:100@192.168.0.10:5060;ob&PJSIP/100_mobile,30,kKtrb(sub-before-con",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761695217.34",
              "linkedid": "1761695216.32",
              "calltype": "2",
              "peeraccount": "100",
              "trunk": 1,
              "recfile": "/var/spool/asterisk/monitor/2025/10/28/174656-IN-NONE-4722571902-168090-1761695216.32.wav",
              "disposition": "Answered Elsewhere",
              "tenant": "mycompany",
              "recording_url": "https://dummy.pbx.com/vrecordings/2025/10/28/174656-IN-NONE-4722571902-168090-1761695216.32.wav",
              "vm_files": []
             },
             {
              "cdr_id": 542,
              "calldate_ts": 1761674732,
              "calldate": "2025-10-28 18:05:32",
              "accountcode": "",
              "source": "4722571902",
              "destination": "101",
              "duration": 16,
              "billsec": 16,
              "channel": "Local/100@queue-call-to-agents-00000006;2",
              "dstchannel": "",
              "lastapp": "VoiceMail",
              "lastdata": "101@mycompany-voicemail,u",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761674634.23",
              "linkedid": "1761674633.21",
              "calltype": "2",
              "peeraccount": "",
              "trunk": 1,
              "recfile": null,
              "disposition": "ANSWERED",
              "tenant": "mycompany",
              "recording_url": null,
              "vm_files": [
               "/var/spool/asterisk/voicemail/mycompany-voicemail/101/INBOX/msg0006.wav"
              ]
             },
             {
              "cdr_id": 541,
              "calldate_ts": 1761674702,
              "calldate": "2025-10-28 18:05:02",
              "accountcode": "",
              "source": "4722571902",
              "destination": "101",
              "duration": 30,
              "billsec": 30,
              "channel": "Local/100@queue-call-to-agents-00000006;2",
              "dstchannel": "PJSIP/101-0000000c",
              "lastapp": "Dial",
              "lastdata": "PJSIP/101/sip:101@192.168.0.10:57084,30,kKtrb(sub-before-connecting-call^s^1(82",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761674634.23",
              "linkedid": "1761674633.21",
              "calltype": "2",
              "peeraccount": "100",
              "trunk": 1,
              "recfile": null,
              "disposition": "NO ANSWER",
              "tenant": "mycompany",
              "recording_url": null,
              "vm_files": []
             },
             {
              "cdr_id": 540,
              "calldate_ts": 1761674634,
              "calldate": "2025-10-28 18:03:54",
              "accountcode": "",
              "source": "4722571902",
              "destination": "100",
              "duration": 67,
              "billsec": 63,
              "channel": "Local/100@queue-call-to-agents-00000006;2",
              "dstchannel": "PJSIP/100-0000000b",
              "lastapp": "Dial",
              "lastdata": "PJSIP/100/sip:100@192.168.0.10:5060;ob&PJSIP/100_mobile,30,kKtrb(sub-before-con",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761674634.23",
              "linkedid": "1761674633.21",
              "calltype": "2",
              "peeraccount": "100",
              "trunk": 1,
              "recfile": "/var/spool/asterisk/monitor/2025/10/28/120354-IN-NONE-4722571902-168090-1761674633.21.wav",
              "disposition": "ANSWERED",
              "tenant": "mycompany",
              "recording_url": "https://dummy.pbx.com/vrecordings/2025/10/28/120354-IN-NONE-4722571902-168090-1761674633.21.wav",
              "vm_files": []
             },
             {
              "cdr_id": 539,
              "calldate_ts": 1761674634,
              "calldate": "2025-10-28 18:03:54",
              "accountcode": "",
              "source": "4722571902",
              "destination": "101",
              "duration": 4,
              "billsec": 0,
              "channel": "Local/101@queue-call-to-agents-00000007;2",
              "dstchannel": "PJSIP/101-0000000a",
              "lastapp": "Dial",
              "lastdata": "PJSIP/101/sip:101@192.168.0.10:57084,30,kKtrb(sub-before-connecting-call^s^1(82",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761674634.25",
              "linkedid": "1761674633.21",
              "calltype": "2",
              "peeraccount": "100",
              "trunk": 1,
              "recfile": "/var/spool/asterisk/monitor/2025/10/28/120354-IN-NONE-4722571902-168090-1761674633.21.wav",
              "disposition": "Answered Elsewhere",
              "tenant": "mycompany",
              "recording_url": "https://dummy.pbx.com/vrecordings/2025/10/28/120354-IN-NONE-4722571902-168090-1761674633.21.wav",
              "vm_files": []
             },
             {
              "cdr_id": 538,
              "calldate_ts": 1761673365,
              "calldate": "2025-10-28 17:42:45",
              "accountcode": "",
              "source": "4722571902",
              "destination": "101",
              "duration": 23,
              "billsec": 19,
              "channel": "Local/101@ring-group-dial-00000004;2",
              "dstchannel": "PJSIP/101-00000007",
              "lastapp": "Dial",
              "lastdata": "PJSIP/101/sip:101@192.168.0.10:57084,10,kKtrb(sub-before-connecting-call^s^1(82",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761673365.16",
              "linkedid": "1761673357.14",
              "calltype": "2",
              "peeraccount": "100",
              "trunk": 1,
              "recfile": "/var/spool/asterisk/monitor/2025/10/28/114237-IN-NONE-4722571902-168090-1761673357.14.wav",
              "disposition": "ANSWERED",
              "tenant": "mycompany",
              "recording_url": "https://dummy.pbx.com/vrecordings/2025/10/28/114237-IN-NONE-4722571902-168090-1761673357.14.wav",
              "vm_files": []
             },
             {
              "cdr_id": 537,
              "calldate_ts": 1761673365,
              "calldate": "2025-10-28 17:42:45",
              "accountcode": "",
              "source": "4722571902",
              "destination": "100",
              "duration": 3,
              "billsec": 0,
              "channel": "Local/100@ring-group-dial-00000005;2",
              "dstchannel": "PJSIP/100-00000008",
              "lastapp": "Dial",
              "lastdata": "PJSIP/100/sip:100@192.168.0.10:5060;ob&PJSIP/100_mobile,10,kKtrb(sub-before-con",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761673365.18",
              "linkedid": "1761673357.14",
              "calltype": "2",
              "peeraccount": "100",
              "trunk": 1,
              "recfile": "/var/spool/asterisk/monitor/2025/10/28/114237-IN-NONE-4722571902-168090-1761673357.14.wav",
              "disposition": "Answered Elsewhere",
              "tenant": "mycompany",
              "recording_url": "https://dummy.pbx.com/vrecordings/2025/10/28/114237-IN-NONE-4722571902-168090-1761673357.14.wav",
              "vm_files": []
             },
             {
              "cdr_id": 536,
              "calldate_ts": 1761669462,
              "calldate": "2025-10-28 16:37:42",
              "accountcode": "",
              "source": "4722571902",
              "destination": "101",
              "duration": 16,
              "billsec": 13,
              "channel": "Local/101@queue-call-to-agents-00000003;2",
              "dstchannel": "PJSIP/101-00000004",
              "lastapp": "Dial",
              "lastdata": "PJSIP/101/sip:101@192.168.0.10:57084,30,kKtrb(sub-before-connecting-call^s^1(82",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761669462.11",
              "linkedid": "1761669461.7",
              "calltype": "2",
              "peeraccount": "100",
              "trunk": 1,
              "recfile": "/var/spool/asterisk/monitor/2025/10/28/103742-IN-NONE-4722571902-168090-1761669461.7.wav",
              "disposition": "ANSWERED",
              "tenant": "mycompany",
              "recording_url": "https://dummy.pbx.com/vrecordings/2025/10/28/103742-IN-NONE-4722571902-168090-1761669461.7.wav",
              "vm_files": []
             },
             {
              "cdr_id": 535,
              "calldate_ts": 1761669462,
              "calldate": "2025-10-28 16:37:42",
              "accountcode": "",
              "source": "4722571902",
              "destination": "100",
              "duration": 3,
              "billsec": 0,
              "channel": "Local/100@queue-call-to-agents-00000002;2",
              "dstchannel": "PJSIP/100-00000005",
              "lastapp": "Dial",
              "lastdata": "PJSIP/100/sip:100@192.168.0.10:5060;ob&PJSIP/100_mobile,30,kKtrb(sub-before-con",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761669462.9",
              "linkedid": "1761669461.7",
              "calltype": "2",
              "peeraccount": "100",
              "trunk": 1,
              "recfile": "/var/spool/asterisk/monitor/2025/10/28/103742-IN-NONE-4722571902-168090-1761669461.7.wav",
              "disposition": "Answered Elsewhere",
              "tenant": "mycompany",
              "recording_url": "https://dummy.pbx.com/vrecordings/2025/10/28/103742-IN-NONE-4722571902-168090-1761669461.7.wav",
              "vm_files": []
             },
             {
              "cdr_id": 534,
              "calldate_ts": 1761668875,
              "calldate": "2025-10-28 16:27:55",
              "accountcode": "",
              "source": "4722571902",
              "destination": "100",
              "duration": 13,
              "billsec": 8,
              "channel": "Local/100@queue-call-to-agents-00000000;2",
              "dstchannel": "PJSIP/100-00000002",
              "lastapp": "Dial",
              "lastdata": "PJSIP/100/sip:100@192.168.0.10:5060;ob&PJSIP/100_mobile,30,kKtrb(sub-before-con",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761668875.2",
              "linkedid": "1761668874.0",
              "calltype": "2",
              "peeraccount": "100",
              "trunk": 1,
              "recfile": "/var/spool/asterisk/monitor/2025/10/28/102757-IN-Q500-4722571902-100-1761668874.0.wav",
              "disposition": "ANSWERED",
              "tenant": "mycompany",
              "recording_url": "https://dummy.pbx.com/vrecordings/2025/10/28/102757-IN-Q500-4722571902-100-1761668874.0.wav",
              "vm_files": []
             },
             {
              "cdr_id": 533,
              "calldate_ts": 1761668875,
              "calldate": "2025-10-28 16:27:55",
              "accountcode": "",
              "source": "4722571902",
              "destination": "101",
              "duration": 4,
              "billsec": 0,
              "channel": "Local/101@queue-call-to-agents-00000001;2",
              "dstchannel": "PJSIP/101-00000001",
              "lastapp": "Dial",
              "lastdata": "PJSIP/101/sip:101@192.168.0.10:57084,30,kKtrb(sub-before-connecting-call^s^1(82",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761668875.4",
              "linkedid": "1761668874.0",
              "calltype": "2",
              "peeraccount": "100",
              "trunk": 1,
              "recfile": null,
              "disposition": "Answered Elsewhere",
              "tenant": "mycompany",
              "recording_url": null,
              "vm_files": []
             }
            ],
            "rows": 12,
            "meta": {
             "current_page": 1,
             "limit": 100,
             "total_pages": 1,
             "has_next": false,
             "has_prev": false,
             "next_page": null,
             "prev_page": null,
             "links": {
              "next_page_url": null,
              "prev_page_url": null,
              "first_page_url": "http://192.168.0.90/api/v2/cdr?page=1&limit=100",
              "last_page_url": "http://192.168.0.90/api/v2/cdr?page=1&limit=100"
             }
            }
           }
          }
         },
         "get_all_answered_calls": {
          "summary": "Get All Answered Calls",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "result": [
             {
              "cdr_id": 544,
              "calldate_ts": 1761695217,
              "calldate": "2025-10-28 23:46:57",
              "accountcode": "",
              "source": "4722571902",
              "destination": "101",
              "duration": 11,
              "billsec": 9,
              "channel": "Local/101@queue-call-to-agents-00000009;2",
              "dstchannel": "PJSIP/101-0000000e",
              "lastapp": "Dial",
              "lastdata": "PJSIP/101/sip:101@192.168.0.10:51701,30,kKtrb(sub-before-connecting-call^s^1(82",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761695217.36",
              "linkedid": "1761695216.32",
              "calltype": "2",
              "peeraccount": "100",
              "trunk": 1,
              "recfile": "/var/spool/asterisk/monitor/2025/10/28/174656-IN-NONE-4722571902-168090-1761695216.32.wav",
              "disposition": "ANSWERED",
              "tenant": "mycompany",
              "recording_url": "https://dummy.pbx.com/vrecordings/2025/10/28/174656-IN-NONE-4722571902-168090-1761695216.32.wav",
              "vm_files": []
             },
             {
              "cdr_id": 542,
              "calldate_ts": 1761674732,
              "calldate": "2025-10-28 18:05:32",
              "accountcode": "",
              "source": "4722571902",
              "destination": "101",
              "duration": 16,
              "billsec": 16,
              "channel": "Local/100@queue-call-to-agents-00000006;2",
              "dstchannel": "",
              "lastapp": "VoiceMail",
              "lastdata": "101@mycompany-voicemail,u",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761674634.23",
              "linkedid": "1761674633.21",
              "calltype": "2",
              "peeraccount": "",
              "trunk": 1,
              "recfile": null,
              "disposition": "ANSWERED",
              "tenant": "mycompany",
              "recording_url": null,
              "vm_files": [
               "/var/spool/asterisk/voicemail/mycompany-voicemail/101/INBOX/msg0006.wav"
              ]
             },
             {
              "cdr_id": 540,
              "calldate_ts": 1761674634,
              "calldate": "2025-10-28 18:03:54",
              "accountcode": "",
              "source": "4722571902",
              "destination": "100",
              "duration": 67,
              "billsec": 63,
              "channel": "Local/100@queue-call-to-agents-00000006;2",
              "dstchannel": "PJSIP/100-0000000b",
              "lastapp": "Dial",
              "lastdata": "PJSIP/100/sip:100@192.168.0.10:5060;ob&PJSIP/100_mobile,30,kKtrb(sub-before-con",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761674634.23",
              "linkedid": "1761674633.21",
              "calltype": "2",
              "peeraccount": "100",
              "trunk": 1,
              "recfile": "/var/spool/asterisk/monitor/2025/10/28/120354-IN-NONE-4722571902-168090-1761674633.21.wav",
              "disposition": "ANSWERED",
              "tenant": "mycompany",
              "recording_url": "https://dummy.pbx.com/vrecordings/2025/10/28/120354-IN-NONE-4722571902-168090-1761674633.21.wav",
              "vm_files": []
             },
             {
              "cdr_id": 538,
              "calldate_ts": 1761673365,
              "calldate": "2025-10-28 17:42:45",
              "accountcode": "",
              "source": "4722571902",
              "destination": "101",
              "duration": 23,
              "billsec": 19,
              "channel": "Local/101@ring-group-dial-00000004;2",
              "dstchannel": "PJSIP/101-00000007",
              "lastapp": "Dial",
              "lastdata": "PJSIP/101/sip:101@192.168.0.10:57084,10,kKtrb(sub-before-connecting-call^s^1(82",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761673365.16",
              "linkedid": "1761673357.14",
              "calltype": "2",
              "peeraccount": "100",
              "trunk": 1,
              "recfile": "/var/spool/asterisk/monitor/2025/10/28/114237-IN-NONE-4722571902-168090-1761673357.14.wav",
              "disposition": "ANSWERED",
              "tenant": "mycompany",
              "recording_url": "https://dummy.pbx.com/vrecordings/2025/10/28/114237-IN-NONE-4722571902-168090-1761673357.14.wav",
              "vm_files": []
             },
             {
              "cdr_id": 536,
              "calldate_ts": 1761669462,
              "calldate": "2025-10-28 16:37:42",
              "accountcode": "",
              "source": "4722571902",
              "destination": "101",
              "duration": 16,
              "billsec": 13,
              "channel": "Local/101@queue-call-to-agents-00000003;2",
              "dstchannel": "PJSIP/101-00000004",
              "lastapp": "Dial",
              "lastdata": "PJSIP/101/sip:101@192.168.0.10:57084,30,kKtrb(sub-before-connecting-call^s^1(82",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761669462.11",
              "linkedid": "1761669461.7",
              "calltype": "2",
              "peeraccount": "100",
              "trunk": 1,
              "recfile": "/var/spool/asterisk/monitor/2025/10/28/103742-IN-NONE-4722571902-168090-1761669461.7.wav",
              "disposition": "ANSWERED",
              "tenant": "mycompany",
              "recording_url": "https://dummy.pbx.com/vrecordings/2025/10/28/103742-IN-NONE-4722571902-168090-1761669461.7.wav",
              "vm_files": []
             },
             {
              "cdr_id": 534,
              "calldate_ts": 1761668875,
              "calldate": "2025-10-28 16:27:55",
              "accountcode": "",
              "source": "4722571902",
              "destination": "100",
              "duration": 13,
              "billsec": 8,
              "channel": "Local/100@queue-call-to-agents-00000000;2",
              "dstchannel": "PJSIP/100-00000002",
              "lastapp": "Dial",
              "lastdata": "PJSIP/100/sip:100@192.168.0.10:5060;ob&PJSIP/100_mobile,30,kKtrb(sub-before-con",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761668875.2",
              "linkedid": "1761668874.0",
              "calltype": "2",
              "peeraccount": "100",
              "trunk": 1,
              "recfile": "/var/spool/asterisk/monitor/2025/10/28/102757-IN-Q500-4722571902-100-1761668874.0.wav",
              "disposition": "ANSWERED",
              "tenant": "mycompany",
              "recording_url": "https://dummy.pbx.com/vrecordings/2025/10/28/102757-IN-Q500-4722571902-100-1761668874.0.wav",
              "vm_files": []
             }
            ],
            "rows": 12,
            "meta": {
             "current_page": 1,
             "limit": 100,
             "total_pages": 1,
             "has_next": false,
             "has_prev": false,
             "next_page": null,
             "prev_page": null,
             "links": {
              "next_page_url": null,
              "prev_page_url": null,
              "first_page_url": "http://192.168.0.90/api/v2/cdr?search=answered&search_fields=disposition&page=1&limit=100",
              "last_page_url": "http://192.168.0.90/api/v2/cdr?search=answered&search_fields=disposition&page=1&limit=100"
             }
            }
           }
          }
         },
         "get_all_records_for_current_month": {
          "summary": "Get All Records for Current Month",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "result": [
             {
              "cdr_id": 544,
              "calldate_ts": 1761695217,
              "calldate": "2025-10-28 23:46:57",
              "accountcode": "",
              "source": "4722571902",
              "destination": "101",
              "duration": 11,
              "billsec": 9,
              "channel": "Local/101@queue-call-to-agents-00000009;2",
              "dstchannel": "PJSIP/101-0000000e",
              "lastapp": "Dial",
              "lastdata": "PJSIP/101/sip:101@192.168.0.10:51701,30,kKtrb(sub-before-connecting-call^s^1(82",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761695217.36",
              "linkedid": "1761695216.32",
              "calltype": "2",
              "peeraccount": "100",
              "trunk": 1,
              "recfile": "/var/spool/asterisk/monitor/2025/10/28/174656-IN-NONE-4722571902-168090-1761695216.32.wav",
              "disposition": "ANSWERED",
              "tenant": "mycompany",
              "recording_url": "https://dummy.pbx.com/vrecordings/2025/10/28/174656-IN-NONE-4722571902-168090-1761695216.32.wav",
              "vm_files": []
             },
             {
              "cdr_id": 543,
              "calldate_ts": 1761695217,
              "calldate": "2025-10-28 23:46:57",
              "accountcode": "",
              "source": "4722571902",
              "destination": "100",
              "duration": 2,
              "billsec": 0,
              "channel": "Local/100@queue-call-to-agents-00000008;2",
              "dstchannel": "PJSIP/100-0000000f",
              "lastapp": "Dial",
              "lastdata": "PJSIP/100/sip:100@192.168.0.10:5060;ob&PJSIP/100_mobile,30,kKtrb(sub-before-con",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761695217.34",
              "linkedid": "1761695216.32",
              "calltype": "2",
              "peeraccount": "100",
              "trunk": 1,
              "recfile": "/var/spool/asterisk/monitor/2025/10/28/174656-IN-NONE-4722571902-168090-1761695216.32.wav",
              "disposition": "Answered Elsewhere",
              "tenant": "mycompany",
              "recording_url": "https://dummy.pbx.com/vrecordings/2025/10/28/174656-IN-NONE-4722571902-168090-1761695216.32.wav",
              "vm_files": []
             },
             {
              "cdr_id": 542,
              "calldate_ts": 1761674732,
              "calldate": "2025-10-28 18:05:32",
              "accountcode": "",
              "source": "4722571902",
              "destination": "101",
              "duration": 16,
              "billsec": 16,
              "channel": "Local/100@queue-call-to-agents-00000006;2",
              "dstchannel": "",
              "lastapp": "VoiceMail",
              "lastdata": "101@mycompany-voicemail,u",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761674634.23",
              "linkedid": "1761674633.21",
              "calltype": "2",
              "peeraccount": "",
              "trunk": 1,
              "recfile": null,
              "disposition": "ANSWERED",
              "tenant": "mycompany",
              "recording_url": null,
              "vm_files": [
               "/var/spool/asterisk/voicemail/mycompany-voicemail/101/INBOX/msg0006.wav"
              ]
             },
             {
              "cdr_id": 541,
              "calldate_ts": 1761674702,
              "calldate": "2025-10-28 18:05:02",
              "accountcode": "",
              "source": "4722571902",
              "destination": "101",
              "duration": 30,
              "billsec": 30,
              "channel": "Local/100@queue-call-to-agents-00000006;2",
              "dstchannel": "PJSIP/101-0000000c",
              "lastapp": "Dial",
              "lastdata": "PJSIP/101/sip:101@192.168.0.10:57084,30,kKtrb(sub-before-connecting-call^s^1(82",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761674634.23",
              "linkedid": "1761674633.21",
              "calltype": "2",
              "peeraccount": "100",
              "trunk": 1,
              "recfile": null,
              "disposition": "NO ANSWER",
              "tenant": "mycompany",
              "recording_url": null,
              "vm_files": []
             },
             {
              "cdr_id": 540,
              "calldate_ts": 1761674634,
              "calldate": "2025-10-28 18:03:54",
              "accountcode": "",
              "source": "4722571902",
              "destination": "100",
              "duration": 67,
              "billsec": 63,
              "channel": "Local/100@queue-call-to-agents-00000006;2",
              "dstchannel": "PJSIP/100-0000000b",
              "lastapp": "Dial",
              "lastdata": "PJSIP/100/sip:100@192.168.0.10:5060;ob&PJSIP/100_mobile,30,kKtrb(sub-before-con",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761674634.23",
              "linkedid": "1761674633.21",
              "calltype": "2",
              "peeraccount": "100",
              "trunk": 1,
              "recfile": "/var/spool/asterisk/monitor/2025/10/28/120354-IN-NONE-4722571902-168090-1761674633.21.wav",
              "disposition": "ANSWERED",
              "tenant": "mycompany",
              "recording_url": "https://dummy.pbx.com/vrecordings/2025/10/28/120354-IN-NONE-4722571902-168090-1761674633.21.wav",
              "vm_files": []
             },
             {
              "cdr_id": 539,
              "calldate_ts": 1761674634,
              "calldate": "2025-10-28 18:03:54",
              "accountcode": "",
              "source": "4722571902",
              "destination": "101",
              "duration": 4,
              "billsec": 0,
              "channel": "Local/101@queue-call-to-agents-00000007;2",
              "dstchannel": "PJSIP/101-0000000a",
              "lastapp": "Dial",
              "lastdata": "PJSIP/101/sip:101@192.168.0.10:57084,30,kKtrb(sub-before-connecting-call^s^1(82",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761674634.25",
              "linkedid": "1761674633.21",
              "calltype": "2",
              "peeraccount": "100",
              "trunk": 1,
              "recfile": "/var/spool/asterisk/monitor/2025/10/28/120354-IN-NONE-4722571902-168090-1761674633.21.wav",
              "disposition": "Answered Elsewhere",
              "tenant": "mycompany",
              "recording_url": "https://dummy.pbx.com/vrecordings/2025/10/28/120354-IN-NONE-4722571902-168090-1761674633.21.wav",
              "vm_files": []
             },
             {
              "cdr_id": 538,
              "calldate_ts": 1761673365,
              "calldate": "2025-10-28 17:42:45",
              "accountcode": "",
              "source": "4722571902",
              "destination": "101",
              "duration": 23,
              "billsec": 19,
              "channel": "Local/101@ring-group-dial-00000004;2",
              "dstchannel": "PJSIP/101-00000007",
              "lastapp": "Dial",
              "lastdata": "PJSIP/101/sip:101@192.168.0.10:57084,10,kKtrb(sub-before-connecting-call^s^1(82",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761673365.16",
              "linkedid": "1761673357.14",
              "calltype": "2",
              "peeraccount": "100",
              "trunk": 1,
              "recfile": "/var/spool/asterisk/monitor/2025/10/28/114237-IN-NONE-4722571902-168090-1761673357.14.wav",
              "disposition": "ANSWERED",
              "tenant": "mycompany",
              "recording_url": "https://dummy.pbx.com/vrecordings/2025/10/28/114237-IN-NONE-4722571902-168090-1761673357.14.wav",
              "vm_files": []
             },
             {
              "cdr_id": 537,
              "calldate_ts": 1761673365,
              "calldate": "2025-10-28 17:42:45",
              "accountcode": "",
              "source": "4722571902",
              "destination": "100",
              "duration": 3,
              "billsec": 0,
              "channel": "Local/100@ring-group-dial-00000005;2",
              "dstchannel": "PJSIP/100-00000008",
              "lastapp": "Dial",
              "lastdata": "PJSIP/100/sip:100@192.168.0.10:5060;ob&PJSIP/100_mobile,10,kKtrb(sub-before-con",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761673365.18",
              "linkedid": "1761673357.14",
              "calltype": "2",
              "peeraccount": "100",
              "trunk": 1,
              "recfile": "/var/spool/asterisk/monitor/2025/10/28/114237-IN-NONE-4722571902-168090-1761673357.14.wav",
              "disposition": "Answered Elsewhere",
              "tenant": "mycompany",
              "recording_url": "https://dummy.pbx.com/vrecordings/2025/10/28/114237-IN-NONE-4722571902-168090-1761673357.14.wav",
              "vm_files": []
             },
             {
              "cdr_id": 536,
              "calldate_ts": 1761669462,
              "calldate": "2025-10-28 16:37:42",
              "accountcode": "",
              "source": "4722571902",
              "destination": "101",
              "duration": 16,
              "billsec": 13,
              "channel": "Local/101@queue-call-to-agents-00000003;2",
              "dstchannel": "PJSIP/101-00000004",
              "lastapp": "Dial",
              "lastdata": "PJSIP/101/sip:101@192.168.0.10:57084,30,kKtrb(sub-before-connecting-call^s^1(82",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761669462.11",
              "linkedid": "1761669461.7",
              "calltype": "2",
              "peeraccount": "100",
              "trunk": 1,
              "recfile": "/var/spool/asterisk/monitor/2025/10/28/103742-IN-NONE-4722571902-168090-1761669461.7.wav",
              "disposition": "ANSWERED",
              "tenant": "mycompany",
              "recording_url": "https://dummy.pbx.com/vrecordings/2025/10/28/103742-IN-NONE-4722571902-168090-1761669461.7.wav",
              "vm_files": []
             },
             {
              "cdr_id": 535,
              "calldate_ts": 1761669462,
              "calldate": "2025-10-28 16:37:42",
              "accountcode": "",
              "source": "4722571902",
              "destination": "100",
              "duration": 3,
              "billsec": 0,
              "channel": "Local/100@queue-call-to-agents-00000002;2",
              "dstchannel": "PJSIP/100-00000005",
              "lastapp": "Dial",
              "lastdata": "PJSIP/100/sip:100@192.168.0.10:5060;ob&PJSIP/100_mobile,30,kKtrb(sub-before-con",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761669462.9",
              "linkedid": "1761669461.7",
              "calltype": "2",
              "peeraccount": "100",
              "trunk": 1,
              "recfile": "/var/spool/asterisk/monitor/2025/10/28/103742-IN-NONE-4722571902-168090-1761669461.7.wav",
              "disposition": "Answered Elsewhere",
              "tenant": "mycompany",
              "recording_url": "https://dummy.pbx.com/vrecordings/2025/10/28/103742-IN-NONE-4722571902-168090-1761669461.7.wav",
              "vm_files": []
             },
             {
              "cdr_id": 534,
              "calldate_ts": 1761668875,
              "calldate": "2025-10-28 16:27:55",
              "accountcode": "",
              "source": "4722571902",
              "destination": "100",
              "duration": 13,
              "billsec": 8,
              "channel": "Local/100@queue-call-to-agents-00000000;2",
              "dstchannel": "PJSIP/100-00000002",
              "lastapp": "Dial",
              "lastdata": "PJSIP/100/sip:100@192.168.0.10:5060;ob&PJSIP/100_mobile,30,kKtrb(sub-before-con",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761668875.2",
              "linkedid": "1761668874.0",
              "calltype": "2",
              "peeraccount": "100",
              "trunk": 1,
              "recfile": "/var/spool/asterisk/monitor/2025/10/28/102757-IN-Q500-4722571902-100-1761668874.0.wav",
              "disposition": "ANSWERED",
              "tenant": "mycompany",
              "recording_url": "https://dummy.pbx.com/vrecordings/2025/10/28/102757-IN-Q500-4722571902-100-1761668874.0.wav",
              "vm_files": []
             },
             {
              "cdr_id": 533,
              "calldate_ts": 1761668875,
              "calldate": "2025-10-28 16:27:55",
              "accountcode": "",
              "source": "4722571902",
              "destination": "101",
              "duration": 4,
              "billsec": 0,
              "channel": "Local/101@queue-call-to-agents-00000001;2",
              "dstchannel": "PJSIP/101-00000001",
              "lastapp": "Dial",
              "lastdata": "PJSIP/101/sip:101@192.168.0.10:57084,30,kKtrb(sub-before-connecting-call^s^1(82",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761668875.4",
              "linkedid": "1761668874.0",
              "calltype": "2",
              "peeraccount": "100",
              "trunk": 1,
              "recfile": null,
              "disposition": "Answered Elsewhere",
              "tenant": "mycompany",
              "recording_url": null,
              "vm_files": []
             }
            ],
            "rows": 12,
            "meta": {
             "current_page": 1,
             "limit": null,
             "total_pages": 1,
             "has_next": false,
             "has_prev": false,
             "next_page": null,
             "prev_page": null,
             "links": {
              "next_page_url": null,
              "prev_page_url": null,
              "first_page_url": null,
              "last_page_url": null
             }
            }
           }
          }
         },
         "search_by_disposition": {
          "summary": "Search by Disposition",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "result": [
             {
              "cdr_id": 544,
              "calldate_ts": 1761695217,
              "calldate": "2025-10-28 23:46:57",
              "accountcode": "",
              "source": "4722571902",
              "destination": "101",
              "duration": 11,
              "billsec": 9,
              "channel": "Local/101@queue-call-to-agents-00000009;2",
              "dstchannel": "PJSIP/101-0000000e",
              "lastapp": "Dial",
              "lastdata": "PJSIP/101/sip:101@192.168.0.10:51701,30,kKtrb(sub-before-connecting-call^s^1(82",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761695217.36",
              "linkedid": "1761695216.32",
              "calltype": "2",
              "peeraccount": "100",
              "trunk": 1,
              "recfile": "/var/spool/asterisk/monitor/2025/10/28/174656-IN-NONE-4722571902-168090-1761695216.32.wav",
              "disposition": "ANSWERED",
              "tenant": "mycompany",
              "recording_url": "https://dummy.pbx.com/vrecordings/2025/10/28/174656-IN-NONE-4722571902-168090-1761695216.32.wav",
              "vm_files": []
             },
             {
              "cdr_id": 542,
              "calldate_ts": 1761674732,
              "calldate": "2025-10-28 18:05:32",
              "accountcode": "",
              "source": "4722571902",
              "destination": "101",
              "duration": 16,
              "billsec": 16,
              "channel": "Local/100@queue-call-to-agents-00000006;2",
              "dstchannel": "",
              "lastapp": "VoiceMail",
              "lastdata": "101@mycompany-voicemail,u",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761674634.23",
              "linkedid": "1761674633.21",
              "calltype": "2",
              "peeraccount": "",
              "trunk": 1,
              "recfile": null,
              "disposition": "ANSWERED",
              "tenant": "mycompany",
              "recording_url": null,
              "vm_files": [
               "/var/spool/asterisk/voicemail/mycompany-voicemail/101/INBOX/msg0006.wav"
              ]
             },
             {
              "cdr_id": 540,
              "calldate_ts": 1761674634,
              "calldate": "2025-10-28 18:03:54",
              "accountcode": "",
              "source": "4722571902",
              "destination": "100",
              "duration": 67,
              "billsec": 63,
              "channel": "Local/100@queue-call-to-agents-00000006;2",
              "dstchannel": "PJSIP/100-0000000b",
              "lastapp": "Dial",
              "lastdata": "PJSIP/100/sip:100@192.168.0.10:5060;ob&PJSIP/100_mobile,30,kKtrb(sub-before-con",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761674634.23",
              "linkedid": "1761674633.21",
              "calltype": "2",
              "peeraccount": "100",
              "trunk": 1,
              "recfile": "/var/spool/asterisk/monitor/2025/10/28/120354-IN-NONE-4722571902-168090-1761674633.21.wav",
              "disposition": "ANSWERED",
              "tenant": "mycompany",
              "recording_url": "https://dummy.pbx.com/vrecordings/2025/10/28/120354-IN-NONE-4722571902-168090-1761674633.21.wav",
              "vm_files": []
             },
             {
              "cdr_id": 538,
              "calldate_ts": 1761673365,
              "calldate": "2025-10-28 17:42:45",
              "accountcode": "",
              "source": "4722571902",
              "destination": "101",
              "duration": 23,
              "billsec": 19,
              "channel": "Local/101@ring-group-dial-00000004;2",
              "dstchannel": "PJSIP/101-00000007",
              "lastapp": "Dial",
              "lastdata": "PJSIP/101/sip:101@192.168.0.10:57084,10,kKtrb(sub-before-connecting-call^s^1(82",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761673365.16",
              "linkedid": "1761673357.14",
              "calltype": "2",
              "peeraccount": "100",
              "trunk": 1,
              "recfile": "/var/spool/asterisk/monitor/2025/10/28/114237-IN-NONE-4722571902-168090-1761673357.14.wav",
              "disposition": "ANSWERED",
              "tenant": "mycompany",
              "recording_url": "https://dummy.pbx.com/vrecordings/2025/10/28/114237-IN-NONE-4722571902-168090-1761673357.14.wav",
              "vm_files": []
             },
             {
              "cdr_id": 536,
              "calldate_ts": 1761669462,
              "calldate": "2025-10-28 16:37:42",
              "accountcode": "",
              "source": "4722571902",
              "destination": "101",
              "duration": 16,
              "billsec": 13,
              "channel": "Local/101@queue-call-to-agents-00000003;2",
              "dstchannel": "PJSIP/101-00000004",
              "lastapp": "Dial",
              "lastdata": "PJSIP/101/sip:101@192.168.0.10:57084,30,kKtrb(sub-before-connecting-call^s^1(82",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761669462.11",
              "linkedid": "1761669461.7",
              "calltype": "2",
              "peeraccount": "100",
              "trunk": 1,
              "recfile": "/var/spool/asterisk/monitor/2025/10/28/103742-IN-NONE-4722571902-168090-1761669461.7.wav",
              "disposition": "ANSWERED",
              "tenant": "mycompany",
              "recording_url": "https://dummy.pbx.com/vrecordings/2025/10/28/103742-IN-NONE-4722571902-168090-1761669461.7.wav",
              "vm_files": []
             },
             {
              "cdr_id": 534,
              "calldate_ts": 1761668875,
              "calldate": "2025-10-28 16:27:55",
              "accountcode": "",
              "source": "4722571902",
              "destination": "100",
              "duration": 13,
              "billsec": 8,
              "channel": "Local/100@queue-call-to-agents-00000000;2",
              "dstchannel": "PJSIP/100-00000002",
              "lastapp": "Dial",
              "lastdata": "PJSIP/100/sip:100@192.168.0.10:5060;ob&PJSIP/100_mobile,30,kKtrb(sub-before-con",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761668875.2",
              "linkedid": "1761668874.0",
              "calltype": "2",
              "peeraccount": "100",
              "trunk": 1,
              "recfile": "/var/spool/asterisk/monitor/2025/10/28/102757-IN-Q500-4722571902-100-1761668874.0.wav",
              "disposition": "ANSWERED",
              "tenant": "mycompany",
              "recording_url": "https://dummy.pbx.com/vrecordings/2025/10/28/102757-IN-Q500-4722571902-100-1761668874.0.wav",
              "vm_files": []
             }
            ],
            "rows": 12,
            "meta": {
             "current_page": 1,
             "limit": 100,
             "total_pages": 1,
             "has_next": false,
             "has_prev": false,
             "next_page": null,
             "prev_page": null,
             "links": {
              "next_page_url": null,
              "prev_page_url": null,
              "first_page_url": "http://192.168.0.90/api/v2/cdr?search=answered&search_fields=disposition&page=1&limit=100",
              "last_page_url": "http://192.168.0.90/api/v2/cdr?search=answered&search_fields=disposition&page=1&limit=100"
             }
            }
           }
          }
         },
         "call_history_between_two_numbers_extensions": {
          "summary": "Call History Between Two Numbers/Extensions",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "result": [
             {
              "cdr_id": 544,
              "calldate_ts": 1761695217,
              "calldate": "2025-10-28 23:46:57",
              "accountcode": "",
              "source": "4722571902",
              "destination": "101",
              "duration": 11,
              "billsec": 9,
              "channel": "Local/101@queue-call-to-agents-00000009;2",
              "dstchannel": "PJSIP/101-0000000e",
              "lastapp": "Dial",
              "lastdata": "PJSIP/101/sip:101@192.168.0.10:51701,30,kKtrb(sub-before-connecting-call^s^1(82",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761695217.36",
              "linkedid": "1761695216.32",
              "calltype": "2",
              "peeraccount": "100",
              "trunk": 1,
              "recfile": "/var/spool/asterisk/monitor/2025/10/28/174656-IN-NONE-4722571902-168090-1761695216.32.wav",
              "disposition": "ANSWERED",
              "tenant": "mycompany",
              "recording_url": "https://dummy.pbx.com/vrecordings/2025/10/28/174656-IN-NONE-4722571902-168090-1761695216.32.wav",
              "vm_files": []
             },
             {
              "cdr_id": 542,
              "calldate_ts": 1761674732,
              "calldate": "2025-10-28 18:05:32",
              "accountcode": "",
              "source": "4722571902",
              "destination": "101",
              "duration": 16,
              "billsec": 16,
              "channel": "Local/100@queue-call-to-agents-00000006;2",
              "dstchannel": "",
              "lastapp": "VoiceMail",
              "lastdata": "101@mycompany-voicemail,u",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761674634.23",
              "linkedid": "1761674633.21",
              "calltype": "2",
              "peeraccount": "",
              "trunk": 1,
              "recfile": null,
              "disposition": "ANSWERED",
              "tenant": "mycompany",
              "recording_url": null,
              "vm_files": [
               "/var/spool/asterisk/voicemail/mycompany-voicemail/101/INBOX/msg0006.wav"
              ]
             },
             {
              "cdr_id": 541,
              "calldate_ts": 1761674702,
              "calldate": "2025-10-28 18:05:02",
              "accountcode": "",
              "source": "4722571902",
              "destination": "101",
              "duration": 30,
              "billsec": 30,
              "channel": "Local/100@queue-call-to-agents-00000006;2",
              "dstchannel": "PJSIP/101-0000000c",
              "lastapp": "Dial",
              "lastdata": "PJSIP/101/sip:101@192.168.0.10:57084,30,kKtrb(sub-before-connecting-call^s^1(82",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761674634.23",
              "linkedid": "1761674633.21",
              "calltype": "2",
              "peeraccount": "100",
              "trunk": 1,
              "recfile": null,
              "disposition": "NO ANSWER",
              "tenant": "mycompany",
              "recording_url": null,
              "vm_files": []
             },
             {
              "cdr_id": 539,
              "calldate_ts": 1761674634,
              "calldate": "2025-10-28 18:03:54",
              "accountcode": "",
              "source": "4722571902",
              "destination": "101",
              "duration": 4,
              "billsec": 0,
              "channel": "Local/101@queue-call-to-agents-00000007;2",
              "dstchannel": "PJSIP/101-0000000a",
              "lastapp": "Dial",
              "lastdata": "PJSIP/101/sip:101@192.168.0.10:57084,30,kKtrb(sub-before-connecting-call^s^1(82",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761674634.25",
              "linkedid": "1761674633.21",
              "calltype": "2",
              "peeraccount": "100",
              "trunk": 1,
              "recfile": "/var/spool/asterisk/monitor/2025/10/28/120354-IN-NONE-4722571902-168090-1761674633.21.wav",
              "disposition": "Answered Elsewhere",
              "tenant": "mycompany",
              "recording_url": "https://dummy.pbx.com/vrecordings/2025/10/28/120354-IN-NONE-4722571902-168090-1761674633.21.wav",
              "vm_files": []
             },
             {
              "cdr_id": 538,
              "calldate_ts": 1761673365,
              "calldate": "2025-10-28 17:42:45",
              "accountcode": "",
              "source": "4722571902",
              "destination": "101",
              "duration": 23,
              "billsec": 19,
              "channel": "Local/101@ring-group-dial-00000004;2",
              "dstchannel": "PJSIP/101-00000007",
              "lastapp": "Dial",
              "lastdata": "PJSIP/101/sip:101@192.168.0.10:57084,10,kKtrb(sub-before-connecting-call^s^1(82",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761673365.16",
              "linkedid": "1761673357.14",
              "calltype": "2",
              "peeraccount": "100",
              "trunk": 1,
              "recfile": "/var/spool/asterisk/monitor/2025/10/28/114237-IN-NONE-4722571902-168090-1761673357.14.wav",
              "disposition": "ANSWERED",
              "tenant": "mycompany",
              "recording_url": "https://dummy.pbx.com/vrecordings/2025/10/28/114237-IN-NONE-4722571902-168090-1761673357.14.wav",
              "vm_files": []
             },
             {
              "cdr_id": 536,
              "calldate_ts": 1761669462,
              "calldate": "2025-10-28 16:37:42",
              "accountcode": "",
              "source": "4722571902",
              "destination": "101",
              "duration": 16,
              "billsec": 13,
              "channel": "Local/101@queue-call-to-agents-00000003;2",
              "dstchannel": "PJSIP/101-00000004",
              "lastapp": "Dial",
              "lastdata": "PJSIP/101/sip:101@192.168.0.10:57084,30,kKtrb(sub-before-connecting-call^s^1(82",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761669462.11",
              "linkedid": "1761669461.7",
              "calltype": "2",
              "peeraccount": "100",
              "trunk": 1,
              "recfile": "/var/spool/asterisk/monitor/2025/10/28/103742-IN-NONE-4722571902-168090-1761669461.7.wav",
              "disposition": "ANSWERED",
              "tenant": "mycompany",
              "recording_url": "https://dummy.pbx.com/vrecordings/2025/10/28/103742-IN-NONE-4722571902-168090-1761669461.7.wav",
              "vm_files": []
             },
             {
              "cdr_id": 533,
              "calldate_ts": 1761668875,
              "calldate": "2025-10-28 16:27:55",
              "accountcode": "",
              "source": "4722571902",
              "destination": "101",
              "duration": 4,
              "billsec": 0,
              "channel": "Local/101@queue-call-to-agents-00000001;2",
              "dstchannel": "PJSIP/101-00000001",
              "lastapp": "Dial",
              "lastdata": "PJSIP/101/sip:101@192.168.0.10:57084,30,kKtrb(sub-before-connecting-call^s^1(82",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1761668875.4",
              "linkedid": "1761668874.0",
              "calltype": "2",
              "peeraccount": "100",
              "trunk": 1,
              "recfile": null,
              "disposition": "Answered Elsewhere",
              "tenant": "mycompany",
              "recording_url": null,
              "vm_files": []
             }
            ],
            "rows": 7,
            "meta": {
             "current_page": 1,
             "limit": 100,
             "total_pages": 1,
             "has_next": false,
             "has_prev": false,
             "next_page": null,
             "prev_page": null,
             "links": {
              "next_page_url": null,
              "prev_page_url": null,
              "first_page_url": "http://192.168.0.90/api/v2/cdr?extensions=101%2C4722571902&call_history=yes&page=1&limit=100",
              "last_page_url": "http://192.168.0.90/api/v2/cdr?extensions=101%2C4722571902&call_history=yes&page=1&limit=100"
             }
            }
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "object",
           "properties": {
            "result": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "cdr_id": {
                "type": "integer"
               },
               "calldate_ts": {
                "type": "integer"
               },
               "calldate": {
                "type": "string"
               },
               "accountcode": {
                "type": "string"
               },
               "source": {
                "type": "string"
               },
               "destination": {
                "type": "string"
               },
               "duration": {
                "type": "integer"
               },
               "billsec": {
                "type": "integer"
               },
               "channel": {
                "type": "string"
               },
               "dstchannel": {
                "type": "string"
               },
               "lastapp": {
                "type": "string"
               },
               "lastdata": {
                "type": "string"
               },
               "auth_code": {},
               "customer_code": {},
               "pin_code": {},
               "uniqueid": {
                "type": "string"
               },
               "linkedid": {
                "type": "string"
               },
               "calltype": {
                "type": "string"
               },
               "peeraccount": {
                "type": "string"
               },
               "trunk": {
                "type": "integer"
               },
               "recfile": {
                "type": "string"
               },
               "disposition": {
                "type": "string"
               },
               "tenant": {
                "type": "string"
               },
               "recording_url": {
                "type": "string"
               },
               "vm_files": {
                "type": "array",
                "items": {}
               }
              }
             }
            },
            "rows": {
             "type": "integer"
            },
            "meta": {
             "type": "object",
             "properties": {
              "current_page": {
               "type": "integer"
              },
              "limit": {
               "type": "integer"
              },
              "total_pages": {
               "type": "integer"
              },
              "has_next": {
               "type": "boolean"
              },
              "has_prev": {
               "type": "boolean"
              },
              "next_page": {},
              "prev_page": {},
              "links": {
               "type": "object",
               "properties": {
                "next_page_url": {},
                "prev_page_url": {},
                "first_page_url": {
                 "type": "string"
                },
                "last_page_url": {
                 "type": "string"
                }
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/devices": {
   "get": {
    "tags": [
     "Devices"
    ],
    "summary": "List devices",
    "description": "Get all devices filtered by Tenant",
    "operationId": "get_devices",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_all_devices_retrieved": {
          "summary": "200 - All devices retrieved",
          "value": {
           "status": "success",
           "message": null,
           "data": [
            {
             "device_id": 3,
             "extension_id": 3,
             "profile_id": 1,
             "user": "dev_7502",
             "secret": "super_pass_2019",
             "description": "X-Lite",
             "ring_device": true,
             "technology": "sip",
             "assigned_exten": "7502",
             "tenant_id": 1,
             "device_name": "dev_7502"
            },
            {
             "device_id": 41,
             "extension_id": 38,
             "profile_id": 1,
             "user": "dev_3806",
             "secret": "super_pass_2019",
             "description": "Edwin Mobile",
             "ring_device": true,
             "technology": "sip",
             "assigned_exten": "3806",
             "tenant_id": 1,
             "device_name": "dev_3806"
            },
            {
             "device_id": 42,
             "extension_id": 38,
             "profile_id": 1,
             "user": "3806",
             "secret": "super_pass_2019",
             "description": "Edwin Desk",
             "ring_device": true,
             "technology": "sip",
             "assigned_exten": "3806",
             "tenant_id": 1,
             "device_name": "3806"
            },
            {
             "device_id": 256,
             "extension_id": 247,
             "profile_id": 14,
             "user": "1004",
             "secret": "469BqVvCMc9wpq",
             "description": "PJSIP EPM",
             "ring_device": true,
             "technology": "pjsip",
             "assigned_exten": null,
             "tenant_id": 1,
             "device_name": "1004"
            },
            {
             "device_id": 258,
             "extension_id": 249,
             "profile_id": 14,
             "user": "2021",
             "secret": "super_pass_2019",
             "description": "VPBX Communicator",
             "ring_device": true,
             "technology": "pjsip",
             "assigned_exten": null,
             "tenant_id": 1,
             "device_name": "2021"
            }
           ]
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "device_id": {
              "type": "integer"
             },
             "extension_id": {
              "type": "integer"
             },
             "profile_id": {
              "type": "integer"
             },
             "user": {
              "type": "string"
             },
             "secret": {
              "type": "string"
             },
             "description": {
              "type": "string"
             },
             "ring_device": {
              "type": "boolean"
             },
             "technology": {
              "type": "string"
             },
             "assigned_exten": {
              "type": "string"
             },
             "tenant_id": {
              "type": "integer"
             },
             "device_name": {
              "type": "string"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/devices/{device_id}": {
   "get": {
    "tags": [
     "Devices"
    ],
    "summary": "Get device",
    "description": "Get an specific device",
    "operationId": "get_devices_device_id",
    "parameters": [
     {
      "name": "device_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "device id"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_single_device_retrieved": {
          "summary": "200 - Single device retrieved",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "device_id": 3,
            "extension_id": 3,
            "profile_id": 1,
            "user": "dev_7502",
            "secret": "super_pass_2019",
            "description": "X-Lite",
            "ring_device": true,
            "technology": "sip",
            "assigned_exten": "7502",
            "tenant_id": 1,
            "device_name": "dev_7502"
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "object",
           "properties": {
            "device_id": {
             "type": "integer"
            },
            "extension_id": {
             "type": "integer"
            },
            "profile_id": {
             "type": "integer"
            },
            "user": {
             "type": "string"
            },
            "secret": {
             "type": "string"
            },
            "description": {
             "type": "string"
            },
            "ring_device": {
             "type": "boolean"
            },
            "technology": {
             "type": "string"
            },
            "assigned_exten": {
             "type": "string"
            },
            "tenant_id": {
             "type": "integer"
            },
            "device_name": {
             "type": "string"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "examples": {
         "404_device_not_found": {
          "summary": "404 - Device not found",
          "value": {
           "status": "not_found",
           "message": "The requested device doesn't exists",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/devices/vitxi": {
   "get": {
    "tags": [
     "Devices"
    ],
    "summary": "List WebPhone devices",
    "description": "Retrieve all the devices flagged with the option \"WebPhone (VitXi)\".",
    "operationId": "get_devices_vitxi",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_devices_retrieved": {
          "summary": "200 - Devices Retrieved",
          "value": {
           "status": "success",
           "message": null,
           "data": [
            {
             "device_id": 22,
             "codecs": null,
             "dtmfmode": "rfc4733",
             "max_contacts": 1,
             "deny": "0.0.0.0/0",
             "permit": "0.0.0.0/0",
             "technology": "pjsip",
             "extension_id": 298,
             "profile_id": 13,
             "user": "9998",
             "secret": "v92ysB4CBJDptc",
             "description": "WebPhone (VitXi)",
             "emergency_cid_name": null,
             "emergency_cid_number": null,
             "ring_device": true,
             "assigned_exten": null,
             "tenant_id": 1,
             "device_name": "9998",
             "send_push": false,
             "vitxi_client": true,
             "dispatchable_location_id": null
            },
            {
             "device_id": 24,
             "codecs": null,
             "dtmfmode": "rfc4733",
             "max_contacts": 1,
             "deny": "0.0.0.0/0",
             "permit": "0.0.0.0/0",
             "technology": "pjsip",
             "extension_id": 300,
             "profile_id": 13,
             "user": "10000",
             "secret": "nv62Vs6BsCcmxU",
             "description": "New Vitxi",
             "emergency_cid_name": null,
             "emergency_cid_number": null,
             "ring_device": true,
             "assigned_exten": null,
             "tenant_id": 1,
             "device_name": "10000",
             "send_push": false,
             "vitxi_client": true,
             "dispatchable_location_id": null
            },
            {
             "device_id": 26,
             "codecs": null,
             "dtmfmode": "rfc4733",
             "max_contacts": 1,
             "deny": "0.0.0.0/0",
             "permit": "0.0.0.0/0",
             "technology": "pjsip",
             "extension_id": null,
             "profile_id": 13,
             "user": "vitxi_hot_desk_2",
             "secret": "z2vgxFRQKWKvDT",
             "description": "Another Hot Desking",
             "emergency_cid_name": null,
             "emergency_cid_number": null,
             "ring_device": true,
             "assigned_exten": null,
             "tenant_id": 1,
             "device_name": "vitxi_hot_desk_2",
             "send_push": false,
             "vitxi_client": true,
             "dispatchable_location_id": null
            }
           ]
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "device_id": {
              "type": "integer"
             },
             "codecs": {},
             "dtmfmode": {
              "type": "string"
             },
             "max_contacts": {
              "type": "integer"
             },
             "deny": {
              "type": "string"
             },
             "permit": {
              "type": "string"
             },
             "technology": {
              "type": "string"
             },
             "extension_id": {
              "type": "integer"
             },
             "profile_id": {
              "type": "integer"
             },
             "user": {
              "type": "string"
             },
             "secret": {
              "type": "string"
             },
             "description": {
              "type": "string"
             },
             "emergency_cid_name": {},
             "emergency_cid_number": {},
             "ring_device": {
              "type": "boolean"
             },
             "assigned_exten": {},
             "tenant_id": {
              "type": "integer"
             },
             "device_name": {
              "type": "string"
             },
             "send_push": {
              "type": "boolean"
             },
             "vitxi_client": {
              "type": "boolean"
             },
             "dispatchable_location_id": {}
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/devices/vitxi/{device_id}": {
   "get": {
    "tags": [
     "Devices"
    ],
    "summary": "Get a WebPhone device with its call data",
    "description": "It returns CDR data, device info, and others from a specific device.",
    "operationId": "get_devices_vitxi_device_id",
    "parameters": [
     {
      "name": "device_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "device id"
     },
     {
      "name": "limit",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      },
      "example": "0,10"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "succesful_request": {
          "summary": "Succesful Request",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "device": {
             "device_id": 12,
             "extension_id": 288,
             "profile_id": 1,
             "user": "101",
             "secret": "ZGv5XGk67hyPU6",
             "description": "MicroSIP",
             "emergency_cid_name": null,
             "emergency_cid_number": null,
             "ring_device": true,
             "technology": "pjsip",
             "assigned_exten": null,
             "tenant_id": 1,
             "device_name": "101",
             "send_push": false,
             "vitxi_client": false,
             "send_welcome_email": false,
             "dispatchable_location_id": null,
             "protocol": "udp",
             "extension": "101"
            },
            "calls": [
             {
              "cdr_id": "960",
              "calldate": "2021-01-23 03:18:31",
              "clid": "\"Agents 2067\" <2067>",
              "did": null,
              "source": "2067",
              "src": "2067",
              "dst": "101",
              "destination": "101",
              "dcontext": "cos-all",
              "channel": "PJSIP/2067-00000004",
              "dstchannel": "",
              "lastapp": "VoiceMail",
              "lastdata": "101@mycompany-voicemail,b",
              "duration": "3",
              "billsec": "3",
              "disposition": "ANSWERED",
              "amaflags": "3",
              "accountcode": "",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1611371901.22",
              "linkedid": "1611371901.22",
              "sequence": "7",
              "peeraccount": "",
              "calltype": "1",
              "recfile": "",
              "tenant": "mycompany",
              "trunk": null
             },
             {
              "cdr_id": "959",
              "calldate": "2021-01-23 03:18:21",
              "clid": "\"Agents 2067\" <2067>",
              "did": null,
              "source": "2067",
              "src": "2067",
              "dst": "101",
              "destination": "101",
              "dcontext": "cos-all",
              "channel": "PJSIP/2067-00000004",
              "dstchannel": "PJSIP/101-00000005",
              "lastapp": "Dial",
              "lastdata": "PJSIP/101/sip:101@192.168.0.5:56088;ob,10,kKtrU(sub-call-recording^713b0732d7b6",
              "duration": "10",
              "billsec": "0",
              "disposition": "NO ANSWER",
              "amaflags": "3",
              "accountcode": "",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1611371901.22",
              "linkedid": "1611371901.22",
              "sequence": "5",
              "peeraccount": "",
              "calltype": "1",
              "recfile": "",
              "tenant": "mycompany",
              "trunk": null
             },
             {
              "cdr_id": "958",
              "calldate": "2021-01-23 03:17:20",
              "clid": "\"Agents 2067\" <2067>",
              "did": null,
              "source": "2067",
              "src": "2067",
              "dst": "101",
              "destination": "101",
              "dcontext": "cos-all",
              "channel": "PJSIP/2067-00000002",
              "dstchannel": "",
              "lastapp": "VoiceMail",
              "lastdata": "101@mycompany-voicemail,b",
              "duration": "8",
              "billsec": "8",
              "disposition": "ANSWERED",
              "amaflags": "3",
              "accountcode": "",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1611371829.14",
              "linkedid": "1611371829.14",
              "sequence": "4",
              "peeraccount": "",
              "calltype": "1",
              "recfile": "",
              "tenant": "mycompany",
              "trunk": null
             },
             {
              "cdr_id": "957",
              "calldate": "2021-01-23 03:17:09",
              "clid": "\"Agents 2067\" <2067>",
              "did": null,
              "source": "2067",
              "src": "2067",
              "dst": "101",
              "destination": "101",
              "dcontext": "cos-all",
              "channel": "PJSIP/2067-00000002",
              "dstchannel": "PJSIP/101-00000003",
              "lastapp": "Dial",
              "lastdata": "PJSIP/101/sip:101@192.168.0.5:56088;ob,10,kKtrU(sub-call-recording^713b0732d7b6",
              "duration": "10",
              "billsec": "0",
              "disposition": "NO ANSWER",
              "amaflags": "3",
              "accountcode": "",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1611371829.14",
              "linkedid": "1611371829.14",
              "sequence": "2",
              "peeraccount": "",
              "calltype": "1",
              "recfile": "",
              "tenant": "mycompany",
              "trunk": null
             },
             {
              "cdr_id": "961",
              "calldate": "2021-01-23 03:16:26",
              "clid": "\"Push Test\" <2502>",
              "did": null,
              "source": "2502",
              "src": "2502",
              "dst": "101",
              "destination": "101",
              "dcontext": "cos-all",
              "channel": "PJSIP/2502-00000000",
              "dstchannel": "PJSIP/101-00000001",
              "lastapp": "Dial",
              "lastdata": "PJSIP/101/sip:101@192.168.0.5:56088;ob,10,kKtrU(sub-call-recording^713b0732d7b6",
              "duration": "287",
              "billsec": "284",
              "disposition": "ANSWERED",
              "amaflags": "3",
              "accountcode": "",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1611371786.12",
              "linkedid": "1611371786.12",
              "sequence": "0",
              "peeraccount": "",
              "calltype": "1",
              "recfile": "/var/spool/asterisk/monitor/2021/01/22/211629-LOCAL-NONE-2502-101-1611371786.13.wav",
              "tenant": "mycompany",
              "trunk": null
             },
             {
              "cdr_id": "943",
              "calldate": "2021-01-22 04:13:30",
              "clid": "\"MicroSIP\" <101>",
              "did": null,
              "source": "101",
              "src": "101",
              "dst": "*71",
              "destination": "*71",
              "dcontext": "cos-all",
              "channel": "PJSIP/101-00000001",
              "dstchannel": "",
              "lastapp": "Hangup",
              "lastdata": "",
              "duration": "8",
              "billsec": "8",
              "disposition": "ANSWERED",
              "amaflags": "3",
              "accountcode": "",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1611288810.6",
              "linkedid": "1611288810.6",
              "sequence": "1",
              "peeraccount": "",
              "calltype": "1",
              "recfile": "",
              "tenant": "mycompany",
              "trunk": null
             },
             {
              "cdr_id": "929",
              "calldate": "2021-01-14 09:39:41",
              "clid": "\"MicroSIP\" <101>",
              "did": null,
              "source": "101",
              "src": "101",
              "dst": "2502",
              "destination": "2502",
              "dcontext": "cos-all",
              "channel": "PJSIP/101-00000002",
              "dstchannel": "Local/2502@pjsip-push-00000001;1",
              "lastapp": "Dial",
              "lastdata": "Local/2502@pjsip-push,30,kKtrU(sub-call-recording^713b0732d7b683af^101^2502^no)",
              "duration": "46",
              "billsec": "39",
              "disposition": "ANSWERED",
              "amaflags": "3",
              "accountcode": "",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1610617181.12",
              "linkedid": "1610617181.12",
              "sequence": "4",
              "peeraccount": "",
              "calltype": "1",
              "recfile": "/var/spool/asterisk/monitor/2021/01/14/033949-LOCAL-NONE-101-2502-1610617181.13.wav",
              "tenant": "mycompany",
              "trunk": null
             },
             {
              "cdr_id": "927",
              "calldate": "2021-01-14 09:38:13",
              "clid": "\"MicroSIP\" <101>",
              "did": null,
              "source": "101",
              "src": "101",
              "dst": "2502",
              "destination": "2502",
              "dcontext": "cos-all",
              "channel": "PJSIP/101-00000000",
              "dstchannel": "Local/2502@pjsip-push-00000000;1",
              "lastapp": "Dial",
              "lastdata": "Local/2502@pjsip-push,30,kKtrU(sub-call-recording^713b0732d7b683af^101^2502^no)",
              "duration": "60",
              "billsec": "52",
              "disposition": "ANSWERED",
              "amaflags": "3",
              "accountcode": "",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1610617093.3",
              "linkedid": "1610617093.3",
              "sequence": "0",
              "peeraccount": "",
              "calltype": "1",
              "recfile": "/var/spool/asterisk/monitor/2021/01/14/033821-LOCAL-NONE-101-2502-1610617093.4.wav",
              "tenant": "mycompany",
              "trunk": null
             },
             {
              "cdr_id": "925",
              "calldate": "2021-01-14 09:31:02",
              "clid": "\"MicroSIP\" <101>",
              "did": null,
              "source": "101",
              "src": "101",
              "dst": "2502",
              "destination": "2502",
              "dcontext": "cos-all",
              "channel": "PJSIP/101-00000000",
              "dstchannel": "",
              "lastapp": "VoiceMail",
              "lastdata": "2502@mycompany-voicemail,u",
              "duration": "2",
              "billsec": "2",
              "disposition": "ANSWERED",
              "amaflags": "3",
              "accountcode": "",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1610616646.3",
              "linkedid": "1610616646.3",
              "sequence": "3",
              "peeraccount": "",
              "calltype": "1",
              "recfile": "",
              "tenant": "mycompany",
              "trunk": null
             },
             {
              "cdr_id": "924",
              "calldate": "2021-01-14 09:30:46",
              "clid": "\"MicroSIP\" <101>",
              "did": null,
              "source": "101",
              "src": "101",
              "dst": "2502",
              "destination": "2502",
              "dcontext": "cos-all",
              "channel": "PJSIP/101-00000000",
              "dstchannel": "Local/2502@pjsip-push-00000000;1",
              "lastapp": "Dial",
              "lastdata": "Local/2502@pjsip-push,30,kKtrU(sub-call-recording^713b0732d7b683af^101^2502^no)",
              "duration": "15",
              "billsec": "0",
              "disposition": "NO ANSWER",
              "amaflags": "3",
              "accountcode": "",
              "auth_code": null,
              "customer_code": null,
              "pin_code": null,
              "uniqueid": "1610616646.3",
              "linkedid": "1610616646.3",
              "sequence": "0",
              "peeraccount": "",
              "calltype": "1",
              "recfile": "",
              "tenant": "mycompany",
              "trunk": null
             }
            ],
            "current_plan": "carrier-plus"
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "object",
           "properties": {
            "device": {
             "type": "object",
             "properties": {
              "device_id": {
               "type": "integer"
              },
              "extension_id": {
               "type": "integer"
              },
              "profile_id": {
               "type": "integer"
              },
              "user": {
               "type": "string"
              },
              "secret": {
               "type": "string"
              },
              "description": {
               "type": "string"
              },
              "emergency_cid_name": {},
              "emergency_cid_number": {},
              "ring_device": {
               "type": "boolean"
              },
              "technology": {
               "type": "string"
              },
              "assigned_exten": {},
              "tenant_id": {
               "type": "integer"
              },
              "device_name": {
               "type": "string"
              },
              "send_push": {
               "type": "boolean"
              },
              "vitxi_client": {
               "type": "boolean"
              },
              "send_welcome_email": {
               "type": "boolean"
              },
              "dispatchable_location_id": {},
              "protocol": {
               "type": "string"
              },
              "extension": {
               "type": "string"
              }
             }
            },
            "calls": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "cdr_id": {
                "type": "string"
               },
               "calldate": {
                "type": "string"
               },
               "clid": {
                "type": "string"
               },
               "did": {},
               "source": {
                "type": "string"
               },
               "src": {
                "type": "string"
               },
               "dst": {
                "type": "string"
               },
               "destination": {
                "type": "string"
               },
               "dcontext": {
                "type": "string"
               },
               "channel": {
                "type": "string"
               },
               "dstchannel": {
                "type": "string"
               },
               "lastapp": {
                "type": "string"
               },
               "lastdata": {
                "type": "string"
               },
               "duration": {
                "type": "string"
               },
               "billsec": {
                "type": "string"
               },
               "disposition": {
                "type": "string"
               },
               "amaflags": {
                "type": "string"
               },
               "accountcode": {
                "type": "string"
               },
               "auth_code": {},
               "customer_code": {},
               "pin_code": {},
               "uniqueid": {
                "type": "string"
               },
               "linkedid": {
                "type": "string"
               },
               "sequence": {
                "type": "string"
               },
               "peeraccount": {
                "type": "string"
               },
               "calltype": {
                "type": "string"
               },
               "recfile": {
                "type": "string"
               },
               "tenant": {
                "type": "string"
               },
               "trunk": {}
              }
             }
            },
            "current_plan": {
             "type": "string"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "examples": {
         "device_not_found": {
          "summary": "Device not found",
          "value": {
           "status": "not_found",
           "message": "The requested device doesn't exists",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/devices/{device_id}/queues": {
   "get": {
    "tags": [
     "Devices"
    ],
    "summary": "List queues of a device",
    "description": "Retrieve the queues associated to a specific device",
    "operationId": "get_devices_device_id_queues",
    "parameters": [
     {
      "name": "device_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "device id"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_queues": {
          "summary": "200 - Queues",
          "value": {
           "status": "success",
           "message": null,
           "data": [
            {
             "queue_id": 5,
             "extension": 500,
             "queue_vip_list_id": null,
             "ivr_id": null,
             "queue_callback_id": null,
             "cron_profile_id": null,
             "description": "Demo",
             "prefix": null,
             "destination_id": 317,
             "hangup_destination_id": 318,
             "strategy": "ringall",
             "music_group_id": 1,
             "weight": null,
             "autofill": true,
             "maxlen": 0,
             "announcement_id": null,
             "periodic_announcement_id": 1,
             "join_announcement_id": null,
             "record": false,
             "servicelevel": 10,
             "wrapuptime": 0,
             "announce_frequency": null,
             "min_announce_frequency": null,
             "periodic_announce_frequency": null,
             "announce_round_seconds": "0",
             "announce_to_first_user": false,
             "announce_position": "no",
             "announce_position_limit": null,
             "relative_periodic_announce": false,
             "announce_holdtime": false,
             "penaltymemberslimit": null,
             "autopause": "no",
             "ringinuse": false,
             "memberdelay": null,
             "timeoutrestart": false,
             "joinempty": "yes",
             "timeoutpriority": "app",
             "timeout": 15,
             "queue_timeout": 30,
             "leavewhenempty": "no",
             "retry": 5,
             "tenant_id": 3,
             "name": "T3_Q500",
             "answered_elsewhere": false,
             "agents_context": "T3_queue-call-to-agents",
             "alertinfo": null,
             "answerchannel": true
            },
            {
             "queue_id": 7,
             "extension": 501,
             "queue_vip_list_id": null,
             "ivr_id": null,
             "queue_callback_id": null,
             "cron_profile_id": null,
             "description": "Sales Management",
             "prefix": null,
             "destination_id": 384,
             "hangup_destination_id": null,
             "strategy": "ringall",
             "music_group_id": 1,
             "weight": null,
             "autofill": true,
             "maxlen": 0,
             "announcement_id": null,
             "periodic_announcement_id": 1,
             "join_announcement_id": null,
             "record": false,
             "servicelevel": null,
             "wrapuptime": 0,
             "announce_frequency": null,
             "min_announce_frequency": null,
             "periodic_announce_frequency": null,
             "announce_round_seconds": "0",
             "announce_to_first_user": false,
             "announce_position": "no",
             "announce_position_limit": null,
             "relative_periodic_announce": false,
             "announce_holdtime": false,
             "penaltymemberslimit": null,
             "autopause": "no",
             "ringinuse": false,
             "memberdelay": null,
             "timeoutrestart": false,
             "joinempty": "yes",
             "timeoutpriority": "app",
             "timeout": 15,
             "queue_timeout": 30,
             "leavewhenempty": "no",
             "retry": 5,
             "tenant_id": 3,
             "name": "T3_Q501",
             "answered_elsewhere": false,
             "agents_context": "T3_queue-call-to-agents",
             "alertinfo": null,
             "answerchannel": true
            }
           ]
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "queue_id": {
              "type": "integer"
             },
             "extension": {
              "type": "integer"
             },
             "queue_vip_list_id": {},
             "ivr_id": {},
             "queue_callback_id": {},
             "cron_profile_id": {},
             "description": {
              "type": "string"
             },
             "prefix": {},
             "destination_id": {
              "type": "integer"
             },
             "hangup_destination_id": {
              "type": "integer"
             },
             "strategy": {
              "type": "string"
             },
             "music_group_id": {
              "type": "integer"
             },
             "weight": {},
             "autofill": {
              "type": "boolean"
             },
             "maxlen": {
              "type": "integer"
             },
             "announcement_id": {},
             "periodic_announcement_id": {
              "type": "integer"
             },
             "join_announcement_id": {},
             "record": {
              "type": "boolean"
             },
             "servicelevel": {
              "type": "integer"
             },
             "wrapuptime": {
              "type": "integer"
             },
             "announce_frequency": {},
             "min_announce_frequency": {},
             "periodic_announce_frequency": {},
             "announce_round_seconds": {
              "type": "string"
             },
             "announce_to_first_user": {
              "type": "boolean"
             },
             "announce_position": {
              "type": "string"
             },
             "announce_position_limit": {},
             "relative_periodic_announce": {
              "type": "boolean"
             },
             "announce_holdtime": {
              "type": "boolean"
             },
             "penaltymemberslimit": {},
             "autopause": {
              "type": "string"
             },
             "ringinuse": {
              "type": "boolean"
             },
             "memberdelay": {},
             "timeoutrestart": {
              "type": "boolean"
             },
             "joinempty": {
              "type": "string"
             },
             "timeoutpriority": {
              "type": "string"
             },
             "timeout": {
              "type": "integer"
             },
             "queue_timeout": {
              "type": "integer"
             },
             "leavewhenempty": {
              "type": "string"
             },
             "retry": {
              "type": "integer"
             },
             "tenant_id": {
              "type": "integer"
             },
             "name": {
              "type": "string"
             },
             "answered_elsewhere": {
              "type": "boolean"
             },
             "agents_context": {
              "type": "string"
             },
             "alertinfo": {},
             "answerchannel": {
              "type": "boolean"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/devices/{device_id}/queues/status": {
   "get": {
    "tags": [
     "Devices"
    ],
    "summary": "Agent status in the device's queues",
    "description": "It returns the status of an agent from its assigned queues.",
    "operationId": "get_devices_device_id_queues_status",
    "parameters": [
     {
      "name": "device_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "device id"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_queues_status": {
          "summary": "200 - Queues Status",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "5": {
             "status": true,
             "paused": false,
             "queue": "T3_Q500",
             "type": "dynamic"
            },
            "7": {
             "status": true,
             "paused": false,
             "queue": "T3_Q501",
             "type": "static"
            }
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "object",
           "properties": {
            "5": {
             "type": "object",
             "properties": {
              "status": {
               "type": "boolean"
              },
              "paused": {
               "type": "boolean"
              },
              "queue": {
               "type": "string"
              },
              "type": {
               "type": "string"
              }
             }
            },
            "7": {
             "type": "object",
             "properties": {
              "status": {
               "type": "boolean"
              },
              "paused": {
               "type": "boolean"
              },
              "queue": {
               "type": "string"
              },
              "type": {
               "type": "string"
              }
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/devices/{device_id}/queues/dynamic": {
   "get": {
    "tags": [
     "Devices"
    ],
    "summary": "Queues where the device is a dynamic member",
    "description": "It retrieves the queues from where the agent is configured as dynamic member",
    "operationId": "get_devices_device_id_queues_dynamic",
    "parameters": [
     {
      "name": "device_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "device id"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_dynamic_queues": {
          "summary": "200 - Dynamic Queues",
          "value": {
           "status": "success",
           "message": null,
           "data": [
            {
             "queue_id": 5,
             "extension": 500,
             "queue_vip_list_id": null,
             "ivr_id": null,
             "queue_callback_id": null,
             "cron_profile_id": null,
             "description": "Demo",
             "prefix": null,
             "destination_id": 317,
             "hangup_destination_id": 318,
             "strategy": "ringall",
             "music_group_id": 1,
             "weight": null,
             "autofill": true,
             "maxlen": 0,
             "announcement_id": null,
             "periodic_announcement_id": 1,
             "join_announcement_id": null,
             "record": false,
             "servicelevel": 10,
             "wrapuptime": 0,
             "announce_frequency": null,
             "min_announce_frequency": null,
             "periodic_announce_frequency": null,
             "announce_round_seconds": "0",
             "announce_to_first_user": false,
             "announce_position": "no",
             "announce_position_limit": null,
             "relative_periodic_announce": false,
             "announce_holdtime": false,
             "penaltymemberslimit": null,
             "autopause": "no",
             "ringinuse": false,
             "memberdelay": null,
             "timeoutrestart": false,
             "joinempty": "yes",
             "timeoutpriority": "app",
             "timeout": 15,
             "queue_timeout": 30,
             "leavewhenempty": "no",
             "retry": 5,
             "tenant_id": 3,
             "name": "T3_Q500",
             "answered_elsewhere": false,
             "agents_context": "T3_queue-call-to-agents",
             "alertinfo": null,
             "answerchannel": true
            }
           ]
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "queue_id": {
              "type": "integer"
             },
             "extension": {
              "type": "integer"
             },
             "queue_vip_list_id": {},
             "ivr_id": {},
             "queue_callback_id": {},
             "cron_profile_id": {},
             "description": {
              "type": "string"
             },
             "prefix": {},
             "destination_id": {
              "type": "integer"
             },
             "hangup_destination_id": {
              "type": "integer"
             },
             "strategy": {
              "type": "string"
             },
             "music_group_id": {
              "type": "integer"
             },
             "weight": {},
             "autofill": {
              "type": "boolean"
             },
             "maxlen": {
              "type": "integer"
             },
             "announcement_id": {},
             "periodic_announcement_id": {
              "type": "integer"
             },
             "join_announcement_id": {},
             "record": {
              "type": "boolean"
             },
             "servicelevel": {
              "type": "integer"
             },
             "wrapuptime": {
              "type": "integer"
             },
             "announce_frequency": {},
             "min_announce_frequency": {},
             "periodic_announce_frequency": {},
             "announce_round_seconds": {
              "type": "string"
             },
             "announce_to_first_user": {
              "type": "boolean"
             },
             "announce_position": {
              "type": "string"
             },
             "announce_position_limit": {},
             "relative_periodic_announce": {
              "type": "boolean"
             },
             "announce_holdtime": {
              "type": "boolean"
             },
             "penaltymemberslimit": {},
             "autopause": {
              "type": "string"
             },
             "ringinuse": {
              "type": "boolean"
             },
             "memberdelay": {},
             "timeoutrestart": {
              "type": "boolean"
             },
             "joinempty": {
              "type": "string"
             },
             "timeoutpriority": {
              "type": "string"
             },
             "timeout": {
              "type": "integer"
             },
             "queue_timeout": {
              "type": "integer"
             },
             "leavewhenempty": {
              "type": "string"
             },
             "retry": {
              "type": "integer"
             },
             "tenant_id": {
              "type": "integer"
             },
             "name": {
              "type": "string"
             },
             "answered_elsewhere": {
              "type": "boolean"
             },
             "agents_context": {
              "type": "string"
             },
             "alertinfo": {},
             "answerchannel": {
              "type": "boolean"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/devices/{device_id}/queues/static": {
   "get": {
    "tags": [
     "Devices"
    ],
    "summary": "Queues where the device is a static member",
    "description": "It retrieves the queues from where the agent is configured as static member",
    "operationId": "get_devices_device_id_queues_static",
    "parameters": [
     {
      "name": "device_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "device id"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_static_queues": {
          "summary": "200 - Static Queues",
          "value": {
           "status": "success",
           "message": null,
           "data": [
            {
             "queue_id": 7,
             "extension": 501,
             "queue_vip_list_id": null,
             "ivr_id": null,
             "queue_callback_id": null,
             "cron_profile_id": null,
             "description": "Sales Management",
             "prefix": null,
             "destination_id": 384,
             "hangup_destination_id": null,
             "strategy": "ringall",
             "music_group_id": 1,
             "weight": null,
             "autofill": true,
             "maxlen": 0,
             "announcement_id": null,
             "periodic_announcement_id": 1,
             "join_announcement_id": null,
             "record": false,
             "servicelevel": null,
             "wrapuptime": 0,
             "announce_frequency": null,
             "min_announce_frequency": null,
             "periodic_announce_frequency": null,
             "announce_round_seconds": "0",
             "announce_to_first_user": false,
             "announce_position": "no",
             "announce_position_limit": null,
             "relative_periodic_announce": false,
             "announce_holdtime": false,
             "penaltymemberslimit": null,
             "autopause": "no",
             "ringinuse": false,
             "memberdelay": null,
             "timeoutrestart": false,
             "joinempty": "yes",
             "timeoutpriority": "app",
             "timeout": 15,
             "queue_timeout": 30,
             "leavewhenempty": "no",
             "retry": 5,
             "tenant_id": 3,
             "name": "T3_Q501",
             "answered_elsewhere": false,
             "agents_context": "T3_queue-call-to-agents",
             "alertinfo": null,
             "answerchannel": true
            }
           ]
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "queue_id": {
              "type": "integer"
             },
             "extension": {
              "type": "integer"
             },
             "queue_vip_list_id": {},
             "ivr_id": {},
             "queue_callback_id": {},
             "cron_profile_id": {},
             "description": {
              "type": "string"
             },
             "prefix": {},
             "destination_id": {
              "type": "integer"
             },
             "hangup_destination_id": {},
             "strategy": {
              "type": "string"
             },
             "music_group_id": {
              "type": "integer"
             },
             "weight": {},
             "autofill": {
              "type": "boolean"
             },
             "maxlen": {
              "type": "integer"
             },
             "announcement_id": {},
             "periodic_announcement_id": {
              "type": "integer"
             },
             "join_announcement_id": {},
             "record": {
              "type": "boolean"
             },
             "servicelevel": {},
             "wrapuptime": {
              "type": "integer"
             },
             "announce_frequency": {},
             "min_announce_frequency": {},
             "periodic_announce_frequency": {},
             "announce_round_seconds": {
              "type": "string"
             },
             "announce_to_first_user": {
              "type": "boolean"
             },
             "announce_position": {
              "type": "string"
             },
             "announce_position_limit": {},
             "relative_periodic_announce": {
              "type": "boolean"
             },
             "announce_holdtime": {
              "type": "boolean"
             },
             "penaltymemberslimit": {},
             "autopause": {
              "type": "string"
             },
             "ringinuse": {
              "type": "boolean"
             },
             "memberdelay": {},
             "timeoutrestart": {
              "type": "boolean"
             },
             "joinempty": {
              "type": "string"
             },
             "timeoutpriority": {
              "type": "string"
             },
             "timeout": {
              "type": "integer"
             },
             "queue_timeout": {
              "type": "integer"
             },
             "leavewhenempty": {
              "type": "string"
             },
             "retry": {
              "type": "integer"
             },
             "tenant_id": {
              "type": "integer"
             },
             "name": {
              "type": "string"
             },
             "answered_elsewhere": {
              "type": "boolean"
             },
             "agents_context": {
              "type": "string"
             },
             "alertinfo": {},
             "answerchannel": {
              "type": "boolean"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/devices/{device_id}/queues-login": {
   "post": {
    "tags": [
     "Devices"
    ],
    "summary": "Log device into queues",
    "description": "It logins a device to provided queues or to all the queues",
    "operationId": "post_devices_device_id_queues_login",
    "parameters": [
     {
      "name": "device_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "device id"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "type": "object",
        "properties": {
         "queues": {
          "type": "string",
          "example": "all"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_login_to_queues": {
          "summary": "200 - Login to Queues",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "5": true
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "object",
           "properties": {
            "5": {
             "type": "boolean"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/devices/{device_id}/queues-pause": {
   "post": {
    "tags": [
     "Devices"
    ],
    "summary": "Pause device in queues",
    "description": "Pause a device from all or a list of queues.",
    "operationId": "post_devices_device_id_queues_pause",
    "parameters": [
     {
      "name": "device_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "device id"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "type": "object",
        "properties": {
         "queues": {
          "type": "string",
          "example": "all"
         },
         "reason": {
          "type": "string",
          "example": "break"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_pause_from_queues": {
          "summary": "200 - Pause from Queues",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "5": {
             "status": true,
             "paused": true,
             "queue": "T3_Q500",
             "type": "dynamic"
            },
            "7": {
             "status": true,
             "paused": true,
             "queue": "T3_Q501",
             "type": "static"
            }
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "object",
           "properties": {
            "5": {
             "type": "object",
             "properties": {
              "status": {
               "type": "boolean"
              },
              "paused": {
               "type": "boolean"
              },
              "queue": {
               "type": "string"
              },
              "type": {
               "type": "string"
              }
             }
            },
            "7": {
             "type": "object",
             "properties": {
              "status": {
               "type": "boolean"
              },
              "paused": {
               "type": "boolean"
              },
              "queue": {
               "type": "string"
              },
              "type": {
               "type": "string"
              }
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/devices/{device_id}/queues-unpause": {
   "post": {
    "tags": [
     "Devices"
    ],
    "summary": "Unpause device in queues",
    "description": "UnPause device from all/list of queues",
    "operationId": "post_devices_device_id_queues_unpause",
    "parameters": [
     {
      "name": "device_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "device id"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "type": "object",
        "properties": {
         "queues": {
          "type": "string",
          "example": "all"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_unpause_from_queues": {
          "summary": "200 - Unpause from Queues",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "5": {
             "status": true,
             "paused": false,
             "queue": "T3_Q500",
             "type": "dynamic"
            },
            "7": {
             "status": true,
             "paused": false,
             "queue": "T3_Q501",
             "type": "static"
            }
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "object",
           "properties": {
            "5": {
             "type": "object",
             "properties": {
              "status": {
               "type": "boolean"
              },
              "paused": {
               "type": "boolean"
              },
              "queue": {
               "type": "string"
              },
              "type": {
               "type": "string"
              }
             }
            },
            "7": {
             "type": "object",
             "properties": {
              "status": {
               "type": "boolean"
              },
              "paused": {
               "type": "boolean"
              },
              "queue": {
               "type": "string"
              },
              "type": {
               "type": "string"
              }
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/devices/{device_id}/queues-logout": {
   "post": {
    "tags": [
     "Devices"
    ],
    "summary": "Log device out of queues",
    "description": "Logout from all the queues assigned to a specific device",
    "operationId": "post_devices_device_id_queues_logout",
    "parameters": [
     {
      "name": "device_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "device id"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "type": "object",
        "properties": {
         "queues": {
          "type": "string",
          "example": "all"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "logout_from_queues": {
          "summary": "Logout from Queues",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "2": {
             "status": false,
             "paused": false,
             "queue": "Q500",
             "type": "unknown"
            },
            "4": {
             "status": false,
             "paused": false,
             "queue": "Q502",
             "type": "unknown"
            }
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "object",
           "properties": {
            "2": {
             "type": "object",
             "properties": {
              "status": {
               "type": "boolean"
              },
              "paused": {
               "type": "boolean"
              },
              "queue": {
               "type": "string"
              },
              "type": {
               "type": "string"
              }
             }
            },
            "4": {
             "type": "object",
             "properties": {
              "status": {
               "type": "boolean"
              },
              "paused": {
               "type": "boolean"
              },
              "queue": {
               "type": "string"
              },
              "type": {
               "type": "string"
              }
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/device_profiles": {
   "get": {
    "tags": [
     "Device Profiles"
    ],
    "summary": "List device profiles",
    "description": "It returns an array with all the available profiles",
    "operationId": "get_device_profiles",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_ok_all_profiles_retrieved": {
          "summary": "200 OK - All Profiles Retrieved",
          "value": {
           "status": "success",
           "message": null,
           "data": [
            {
             "technology": "bri",
             "signaling": "bri_cpe",
             "switchtype": "euroisdn",
             "facility": "disabled",
             "inbanddisconnect": true,
             "facilityenable": "disabled",
             "overlapdial": "no",
             "resetinterval": 0,
             "pridialplan": "unknown",
             "prilocaldialplan": "national",
             "internationalprefix": null,
             "localprefix": null,
             "nationalprefix": null,
             "privateprefix": null,
             "unknownprefix": null,
             "usecallingpres": true,
             "rxgain": "0.000",
             "txgain": "0.000",
             "echocanceler": "oslec",
             "echocancel": "128",
             "echotraining": 0,
             "echocancelwhenbridged": true,
             "echoparams": "",
             "usecallerid": true,
             "hidecallerid": false,
             "relaxdtmf": false,
             "faxdetect": "no",
             "profile_id": 5,
             "name": "Default BRI TE Profile",
             "description": "Default BRI TE Profile",
             "default": true
            },
            {
             "technology": "bri",
             "signaling": "bri_net",
             "switchtype": "euroisdn",
             "facility": "disabled",
             "inbanddisconnect": true,
             "facilityenable": "disabled",
             "overlapdial": "no",
             "resetinterval": 0,
             "pridialplan": "unknown",
             "prilocaldialplan": "national",
             "internationalprefix": null,
             "localprefix": null,
             "nationalprefix": null,
             "privateprefix": null,
             "unknownprefix": null,
             "usecallingpres": true,
             "rxgain": "0.000",
             "txgain": "0.000",
             "echocanceler": "oslec",
             "echocancel": "128",
             "echotraining": 0,
             "echocancelwhenbridged": true,
             "echoparams": "",
             "usecallerid": true,
             "hidecallerid": false,
             "relaxdtmf": false,
             "faxdetect": "no",
             "profile_id": 6,
             "name": "Default BRI NT Profile",
             "description": "Default BRI NT Profile",
             "default": true
            },
            {
             "technology": "e1pri",
             "signaling": "pri_cpe",
             "switchtype": "euroisdn",
             "inbanddisconnect": true,
             "facilityenable": "enabled",
             "overlapdial": "no",
             "resetinterval": 0,
             "pridialplan": "unknown",
             "prilocaldialplan": "national",
             "internationalprefix": null,
             "localprefix": null,
             "nationalprefix": null,
             "privateprefix": null,
             "unknownprefix": null,
             "usecallingpres": true,
             "rxgain": "0.000",
             "txgain": "0.000",
             "echocanceler": "oslec",
             "echocancel": "128",
             "echotraining": 0,
             "echocancelwhenbridged": true,
             "echoparams": "",
             "usecallerid": true,
             "hidecallerid": false,
             "relaxdtmf": false,
             "faxdetect": "no",
             "profile_id": 7,
             "name": "Default E1 PRI Profile",
             "description": "Default E1 PRI Profile",
             "default": true
            },
            {
             "technology": "e1r2",
             "signaling": "mfcr2",
             "switchtype": "euroisdn",
             "variant": "mx",
             "maxani": 10,
             "maxdnis": 4,
             "ani_first": false,
             "category": "national_subscriber",
             "back_timeout": 0,
             "pulse_timeout": 0,
             "collect_calls": false,
             "double_answer": false,
             "immediate_accept": false,
             "skip_category": false,
             "forced_release": false,
             "charge_calls": true,
             "dtmf_dialing": true,
             "default_bits": "1101",
             "log_level": "nothing",
             "log_callfile_dir": null,
             "inbanddisconnect": true,
             "facilityenable": "enabled",
             "overlapdial": "no",
             "resetinterval": 0,
             "pridialplan": "unknown",
             "prilocaldialplan": "national",
             "internationalprefix": null,
             "localprefix": null,
             "nationalprefix": null,
             "privateprefix": null,
             "unknownprefix": null,
             "usecallingpres": true,
             "rxgain": "0.000",
             "txgain": "0.000",
             "echocanceler": "oslec",
             "echocancel": "128",
             "echotraining": 0,
             "echocancelwhenbridged": true,
             "echoparams": "",
             "usecallerid": true,
             "hidecallerid": false,
             "relaxdtmf": false,
             "faxdetect": "no",
             "profile_id": 8,
             "name": "Default E1 R2 Profile",
             "description": "Default E1 R2 Profile",
             "default": true
            },
            {
             "technology": "fxo",
             "signaling": "fxs_ks",
             "cidstart": "ring",
             "cidsignaling": "bell",
             "dtmfcidlevel": 128,
             "polarityonanswerdelay": 600,
             "busydetect": false,
             "busycount": 8,
             "busypattern": null,
             "answeronpolarityswitch": false,
             "hanguponpolarityswitch": false,
             "rxgain": "0.000",
             "txgain": "0.000",
             "echocanceler": "oslec",
             "echocancel": "128",
             "echotraining": 0,
             "echocancelwhenbridged": true,
             "echoparams": "",
             "usecallerid": true,
             "hidecallerid": false,
             "relaxdtmf": false,
             "faxdetect": "no",
             "profile_id": 4,
             "name": "Default FXO Profile",
             "description": "Default FXO Profile",
             "default": true
            },
            {
             "technology": "fxs",
             "signaling": "fxo_ks",
             "rxflash": 650,
             "threewaycalling": true,
             "transfer": true,
             "callwaiting": true,
             "mwisendtype": "hvac",
             "callwaitingcallerid": true,
             "sendcalleridafter": 1,
             "answeronpolarityswitch": false,
             "hanguponpolarityswitch": false,
             "rxgain": "0.000",
             "txgain": "0.000",
             "echocanceler": "oslec",
             "echocancel": "128",
             "echotraining": 0,
             "echocancelwhenbridged": true,
             "echoparams": "",
             "usecallerid": true,
             "hidecallerid": false,
             "relaxdtmf": false,
             "faxdetect": "no",
             "profile_id": 3,
             "name": "Default FXS Profile",
             "description": "Default FXS Profile",
             "default": true
            },
            {
             "technology": "iax",
             "host": "dynamic",
             "peertype": "friend",
             "requirecalltoken": "no",
             "qualify": 2000,
             "qualifyfreq": 60,
             "transfer": "yes",
             "profile_id": 2,
             "name": "Default IAX2 Profile",
             "description": "Default IAX2 Profile",
             "default": true
            },
            {
             "technology": "pjsip",
             "transport": "udp",
             "dtls_cert_id": null,
             "media_encryption": "no",
             "dtls_setup": "actpass",
             "force_rport": true,
             "ice_support": false,
             "rtp_symmetric": true,
             "rewrite_contact": true,
             "use_avpf": false,
             "direct_media": true,
             "disable_direct_media_on_nat": false,
             "dtls_verify": "no",
             "rtcp_mux": false,
             "media_use_received_transport": false,
             "media_encryption_optimistic": false,
             "asymmetric_rtp_codec": false,
             "dtls_fingerprint": "sha-256",
             "dtls_rekey": 0,
             "qualify_frequency": 30,
             "qualify_timeout": 3,
             "webrtc": false,
             "send_diversion": true,
             "send_pai": false,
             "send_rpid": false,
             "remove_existing": true,
             "max_video_streams": 5,
             "max_audio_streams": 5,
             "support_path": false,
             "outbound_proxy": null,
             "profile_id": 1,
             "name": "Default PJSIP Profile",
             "description": "Default PJSIP Profile",
             "default": true,
             "force_avp": false
            },
            {
             "technology": "pjsip",
             "transport": "wss",
             "dtls_cert_id": null,
             "media_encryption": "dtls",
             "dtls_setup": "actpass",
             "force_rport": true,
             "ice_support": true,
             "rtp_symmetric": true,
             "rewrite_contact": false,
             "use_avpf": true,
             "direct_media": true,
             "disable_direct_media_on_nat": true,
             "dtls_verify": "fingerprint",
             "rtcp_mux": true,
             "media_use_received_transport": true,
             "media_encryption_optimistic": false,
             "asymmetric_rtp_codec": true,
             "dtls_fingerprint": "sha-256",
             "dtls_rekey": 0,
             "qualify_frequency": 30,
             "qualify_timeout": 3,
             "webrtc": true,
             "send_diversion": true,
             "send_pai": true,
             "send_rpid": true,
             "remove_existing": true,
             "max_video_streams": 5,
             "max_audio_streams": 5,
             "support_path": false,
             "outbound_proxy": null,
             "profile_id": 13,
             "name": "Default WebRTC Profile",
             "description": "Default WebRTC Profile",
             "default": true,
             "force_avp": false
            },
            {
             "technology": "sip",
             "host": "dynamic",
             "peertype": "friend",
             "qualify": 2000,
             "qualifyfreq": 60,
             "transport": "udp",
             "icesupport": false,
             "encryption": false,
             "avpf": false,
             "directmedia": "nonat",
             "sendrpid": "yes",
             "trustrpid": true,
             "dtlsenable": false,
             "dtls_cert_id": null,
             "dtlsverify": "no",
             "dtlssetup": "actpass",
             "dtlsfingerprint": "sha-256",
             "dtlsrekey": 0,
             "force_avp": false,
             "rtcp_mux": false,
             "profile_id": 11,
             "name": "Default SIP Profile",
             "description": "Default SIP Profile",
             "default": true
            },
            {
             "technology": "t1cas",
             "signaling": "fxs_ks",
             "switchtype": "national",
             "inbanddisconnect": true,
             "facilityenable": "disabled",
             "overlapdial": "no",
             "resetinterval": 0,
             "pridialplan": "unknown",
             "prilocaldialplan": "national",
             "internationalprefix": null,
             "localprefix": null,
             "nationalprefix": null,
             "privateprefix": null,
             "unknownprefix": null,
             "usecallingpres": true,
             "rxgain": "0.000",
             "txgain": "0.000",
             "echocanceler": "oslec",
             "echocancel": "128",
             "echotraining": 0,
             "echocancelwhenbridged": true,
             "echoparams": "",
             "usecallerid": true,
             "hidecallerid": false,
             "relaxdtmf": false,
             "faxdetect": "no",
             "profile_id": 10,
             "name": "Default T1 CAS Profile",
             "description": "Default T1 CAS Profile",
             "default": true
            },
            {
             "technology": "t1pri",
             "signaling": "pri_cpe",
             "switchtype": "national",
             "inbanddisconnect": true,
             "facilityenable": "enabled",
             "overlapdial": "no",
             "resetinterval": 0,
             "pridialplan": "unknown",
             "prilocaldialplan": "national",
             "internationalprefix": null,
             "localprefix": null,
             "nationalprefix": null,
             "privateprefix": null,
             "unknownprefix": null,
             "usecallingpres": true,
             "rxgain": "0.000",
             "txgain": "0.000",
             "echocanceler": "oslec",
             "echocancel": "128",
             "echotraining": 0,
             "echocancelwhenbridged": true,
             "echoparams": "",
             "usecallerid": true,
             "hidecallerid": false,
             "relaxdtmf": false,
             "faxdetect": "no",
             "profile_id": 9,
             "name": "Default T1 PRI Profile",
             "description": "Default T1 PRI Profile",
             "default": true
            }
           ]
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "technology": {
              "type": "string"
             },
             "signaling": {
              "type": "string"
             },
             "switchtype": {
              "type": "string"
             },
             "facility": {
              "type": "string"
             },
             "inbanddisconnect": {
              "type": "boolean"
             },
             "facilityenable": {
              "type": "string"
             },
             "overlapdial": {
              "type": "string"
             },
             "resetinterval": {
              "type": "integer"
             },
             "pridialplan": {
              "type": "string"
             },
             "prilocaldialplan": {
              "type": "string"
             },
             "internationalprefix": {},
             "localprefix": {},
             "nationalprefix": {},
             "privateprefix": {},
             "unknownprefix": {},
             "usecallingpres": {
              "type": "boolean"
             },
             "rxgain": {
              "type": "string"
             },
             "txgain": {
              "type": "string"
             },
             "echocanceler": {
              "type": "string"
             },
             "echocancel": {
              "type": "string"
             },
             "echotraining": {
              "type": "integer"
             },
             "echocancelwhenbridged": {
              "type": "boolean"
             },
             "echoparams": {
              "type": "string"
             },
             "usecallerid": {
              "type": "boolean"
             },
             "hidecallerid": {
              "type": "boolean"
             },
             "relaxdtmf": {
              "type": "boolean"
             },
             "faxdetect": {
              "type": "string"
             },
             "profile_id": {
              "type": "integer"
             },
             "name": {
              "type": "string"
             },
             "description": {
              "type": "string"
             },
             "default": {
              "type": "boolean"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/device_profiles/{id}": {
   "get": {
    "tags": [
     "Device Profiles"
    ],
    "summary": "Get device profile",
    "description": "Retrieve a specific device profile",
    "operationId": "get_device_profiles_id",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "Record ID"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_ok_retrieve_single_profile": {
          "summary": "200 OK - Retrieve Single Profile",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "technology": "pjsip",
            "transport": "udp",
            "dtls_cert_id": null,
            "media_encryption": "no",
            "dtls_setup": "actpass",
            "force_rport": true,
            "ice_support": false,
            "rtp_symmetric": true,
            "rewrite_contact": true,
            "use_avpf": false,
            "direct_media": true,
            "disable_direct_media_on_nat": false,
            "dtls_verify": "no",
            "rtcp_mux": false,
            "media_use_received_transport": false,
            "media_encryption_optimistic": false,
            "asymmetric_rtp_codec": false,
            "dtls_fingerprint": "sha-256",
            "dtls_rekey": 0,
            "qualify_frequency": 30,
            "qualify_timeout": 3,
            "webrtc": false,
            "send_diversion": true,
            "send_pai": false,
            "send_rpid": false,
            "remove_existing": true,
            "max_video_streams": 5,
            "max_audio_streams": 5,
            "support_path": false,
            "outbound_proxy": null,
            "profile_id": 1,
            "name": "Default PJSIP Profile",
            "description": "Default PJSIP Profile",
            "default": true,
            "force_avp": false
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "object",
           "properties": {
            "technology": {
             "type": "string"
            },
            "transport": {
             "type": "string"
            },
            "dtls_cert_id": {},
            "media_encryption": {
             "type": "string"
            },
            "dtls_setup": {
             "type": "string"
            },
            "force_rport": {
             "type": "boolean"
            },
            "ice_support": {
             "type": "boolean"
            },
            "rtp_symmetric": {
             "type": "boolean"
            },
            "rewrite_contact": {
             "type": "boolean"
            },
            "use_avpf": {
             "type": "boolean"
            },
            "direct_media": {
             "type": "boolean"
            },
            "disable_direct_media_on_nat": {
             "type": "boolean"
            },
            "dtls_verify": {
             "type": "string"
            },
            "rtcp_mux": {
             "type": "boolean"
            },
            "media_use_received_transport": {
             "type": "boolean"
            },
            "media_encryption_optimistic": {
             "type": "boolean"
            },
            "asymmetric_rtp_codec": {
             "type": "boolean"
            },
            "dtls_fingerprint": {
             "type": "string"
            },
            "dtls_rekey": {
             "type": "integer"
            },
            "qualify_frequency": {
             "type": "integer"
            },
            "qualify_timeout": {
             "type": "integer"
            },
            "webrtc": {
             "type": "boolean"
            },
            "send_diversion": {
             "type": "boolean"
            },
            "send_pai": {
             "type": "boolean"
            },
            "send_rpid": {
             "type": "boolean"
            },
            "remove_existing": {
             "type": "boolean"
            },
            "max_video_streams": {
             "type": "integer"
            },
            "max_audio_streams": {
             "type": "integer"
            },
            "support_path": {
             "type": "boolean"
            },
            "outbound_proxy": {},
            "profile_id": {
             "type": "integer"
            },
            "name": {
             "type": "string"
            },
            "description": {
             "type": "string"
            },
            "default": {
             "type": "boolean"
            },
            "force_avp": {
             "type": "boolean"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "examples": {
         "404_profile_not_found": {
          "summary": "404 - Profile not found",
          "value": {
           "status": "not_found",
           "message": "The requested profile doesn't exists",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/device_profiles/{id}/devices": {
   "get": {
    "tags": [
     "Device Profiles"
    ],
    "summary": "List devices of a device profile",
    "description": "Retrieve all the devices associated to an specific profile",
    "operationId": "get_device_profiles_id_devices",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "Record ID"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_devices_retrieved": {
          "summary": "200 - Devices Retrieved",
          "value": {
           "status": "success",
           "message": null,
           "data": [
            {
             "device_id": "1",
             "extension_id": null,
             "profile_id": "1",
             "user": "desk001",
             "secret": "VAR6hJYS3JD9sr",
             "description": "Desk 1",
             "emergency_cid_name": null,
             "emergency_cid_number": null,
             "ring_device": "yes",
             "technology": "pjsip",
             "assigned_exten": "4301",
             "tenant_id": "1",
             "device_name": "desk001",
             "send_push": "no",
             "dispatchable_location_id": null
            },
            {
             "device_id": "2",
             "extension_id": null,
             "profile_id": "1",
             "user": "desk002",
             "secret": "QE5jx9K7nKuZU3",
             "description": "Desk 2",
             "emergency_cid_name": null,
             "emergency_cid_number": null,
             "ring_device": "yes",
             "technology": "pjsip",
             "assigned_exten": "4302",
             "tenant_id": "1",
             "device_name": "desk002",
             "send_push": "no",
             "dispatchable_location_id": null
            },
            {
             "device_id": "3",
             "extension_id": null,
             "profile_id": "1",
             "user": "desk003",
             "secret": "2ussxmZWaXY27s",
             "description": "Desk 3",
             "emergency_cid_name": null,
             "emergency_cid_number": null,
             "ring_device": "yes",
             "technology": "pjsip",
             "assigned_exten": null,
             "tenant_id": "1",
             "device_name": "desk003",
             "send_push": "no",
             "dispatchable_location_id": null
            },
            {
             "device_id": "4",
             "extension_id": null,
             "profile_id": "1",
             "user": "desk004",
             "secret": "6HCesqyCQVmw4x",
             "description": "Desk 4",
             "emergency_cid_name": null,
             "emergency_cid_number": null,
             "ring_device": "yes",
             "technology": "pjsip",
             "assigned_exten": null,
             "tenant_id": "1",
             "device_name": "desk004",
             "send_push": "no",
             "dispatchable_location_id": null
            },
            {
             "device_id": "5",
             "extension_id": null,
             "profile_id": "1",
             "user": "desk005",
             "secret": "6u7Z7eBFnt9bRD",
             "description": "Desk 5",
             "emergency_cid_name": null,
             "emergency_cid_number": null,
             "ring_device": "yes",
             "technology": "pjsip",
             "assigned_exten": null,
             "tenant_id": "1",
             "device_name": "desk005",
             "send_push": "no",
             "dispatchable_location_id": null
            },
            {
             "device_id": "6",
             "extension_id": null,
             "profile_id": "1",
             "user": "desk006",
             "secret": "XwhCDUnBatrEC9",
             "description": "Desk 6",
             "emergency_cid_name": null,
             "emergency_cid_number": null,
             "ring_device": "yes",
             "technology": "pjsip",
             "assigned_exten": null,
             "tenant_id": "1",
             "device_name": "desk006",
             "send_push": "no",
             "dispatchable_location_id": null
            },
            {
             "device_id": "7",
             "extension_id": null,
             "profile_id": "1",
             "user": "desk007",
             "secret": "2eddsMHB8mEvQG",
             "description": "Desk 7",
             "emergency_cid_name": null,
             "emergency_cid_number": null,
             "ring_device": "yes",
             "technology": "pjsip",
             "assigned_exten": null,
             "tenant_id": "1",
             "device_name": "desk007",
             "send_push": "no",
             "dispatchable_location_id": null
            },
            {
             "device_id": "8",
             "extension_id": null,
             "profile_id": "1",
             "user": "desk008",
             "secret": "6AY9BF4PnbSzA7",
             "description": "Desk 8",
             "emergency_cid_name": null,
             "emergency_cid_number": null,
             "ring_device": "yes",
             "technology": "pjsip",
             "assigned_exten": null,
             "tenant_id": "1",
             "device_name": "desk008",
             "send_push": "no",
             "dispatchable_location_id": null
            },
            {
             "device_id": "9",
             "extension_id": null,
             "profile_id": "1",
             "user": "desk009",
             "secret": "ZVS3Yrea3cGprr",
             "description": "Desk 9",
             "emergency_cid_name": null,
             "emergency_cid_number": null,
             "ring_device": "yes",
             "technology": "pjsip",
             "assigned_exten": null,
             "tenant_id": "1",
             "device_name": "desk009",
             "send_push": "no",
             "dispatchable_location_id": null
            },
            {
             "device_id": "10",
             "extension_id": null,
             "profile_id": "1",
             "user": "desk010",
             "secret": "g6RQh7yHQcWF4y",
             "description": "Desk 10",
             "emergency_cid_name": null,
             "emergency_cid_number": null,
             "ring_device": "yes",
             "technology": "pjsip",
             "assigned_exten": null,
             "tenant_id": "1",
             "device_name": "desk010",
             "send_push": "no",
             "dispatchable_location_id": null
            },
            {
             "device_id": "11",
             "extension_id": "287",
             "profile_id": "1",
             "user": "100",
             "secret": "Letacla01",
             "description": "Jose Rivera",
             "emergency_cid_name": null,
             "emergency_cid_number": null,
             "ring_device": "yes",
             "technology": "pjsip",
             "assigned_exten": null,
             "tenant_id": "1",
             "device_name": "100",
             "send_push": "yes",
             "dispatchable_location_id": null
            },
            {
             "device_id": "12",
             "extension_id": "288",
             "profile_id": "1",
             "user": "101",
             "secret": "ZGv5XGk67hyPU6",
             "description": "MicroSIP",
             "emergency_cid_name": null,
             "emergency_cid_number": null,
             "ring_device": "yes",
             "technology": "pjsip",
             "assigned_exten": null,
             "tenant_id": "1",
             "device_name": "101",
             "send_push": "no",
             "dispatchable_location_id": null
            }
           ]
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "device_id": {
              "type": "string"
             },
             "extension_id": {},
             "profile_id": {
              "type": "string"
             },
             "user": {
              "type": "string"
             },
             "secret": {
              "type": "string"
             },
             "description": {
              "type": "string"
             },
             "emergency_cid_name": {},
             "emergency_cid_number": {},
             "ring_device": {
              "type": "string"
             },
             "technology": {
              "type": "string"
             },
             "assigned_exten": {
              "type": "string"
             },
             "tenant_id": {
              "type": "string"
             },
             "device_name": {
              "type": "string"
             },
             "send_push": {
              "type": "string"
             },
             "dispatchable_location_id": {}
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "examples": {
         "404_invalid_profile_id": {
          "summary": "404 - Invalid Profile ID",
          "value": {
           "status": "not_found",
           "message": "The requested profile doesn't exists",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/device_profiles/webrtc": {
   "get": {
    "tags": [
     "Device Profiles"
    ],
    "summary": "Get the WebRTC device profile",
    "description": "Retrieve all the PJSIP profile marked as webrtc",
    "operationId": "get_device_profiles_webrtc",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_webrtc_profiles_retrieved": {
          "summary": "200 - WebRTC Profiles Retrieved",
          "value": {
           "status": "success",
           "message": null,
           "data": [
            {
             "technology": "pjsip",
             "transport": "wss",
             "dtls_cert_id": null,
             "media_encryption": "dtls",
             "dtls_setup": "actpass",
             "force_rport": true,
             "ice_support": true,
             "rtp_symmetric": true,
             "rewrite_contact": false,
             "use_avpf": true,
             "direct_media": true,
             "disable_direct_media_on_nat": true,
             "dtls_verify": "fingerprint",
             "rtcp_mux": true,
             "media_use_received_transport": true,
             "media_encryption_optimistic": false,
             "asymmetric_rtp_codec": true,
             "dtls_fingerprint": "sha-256",
             "dtls_rekey": 0,
             "qualify_frequency": 30,
             "qualify_timeout": 3,
             "webrtc": true,
             "send_diversion": true,
             "send_pai": true,
             "send_rpid": true,
             "remove_existing": true,
             "max_video_streams": 5,
             "max_audio_streams": 5,
             "support_path": false,
             "outbound_proxy": null,
             "profile_id": 13,
             "name": "Default WebRTC Profile",
             "description": "Default WebRTC Profile",
             "default": true,
             "force_avp": false
            }
           ]
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "technology": {
              "type": "string"
             },
             "transport": {
              "type": "string"
             },
             "dtls_cert_id": {},
             "media_encryption": {
              "type": "string"
             },
             "dtls_setup": {
              "type": "string"
             },
             "force_rport": {
              "type": "boolean"
             },
             "ice_support": {
              "type": "boolean"
             },
             "rtp_symmetric": {
              "type": "boolean"
             },
             "rewrite_contact": {
              "type": "boolean"
             },
             "use_avpf": {
              "type": "boolean"
             },
             "direct_media": {
              "type": "boolean"
             },
             "disable_direct_media_on_nat": {
              "type": "boolean"
             },
             "dtls_verify": {
              "type": "string"
             },
             "rtcp_mux": {
              "type": "boolean"
             },
             "media_use_received_transport": {
              "type": "boolean"
             },
             "media_encryption_optimistic": {
              "type": "boolean"
             },
             "asymmetric_rtp_codec": {
              "type": "boolean"
             },
             "dtls_fingerprint": {
              "type": "string"
             },
             "dtls_rekey": {
              "type": "integer"
             },
             "qualify_frequency": {
              "type": "integer"
             },
             "qualify_timeout": {
              "type": "integer"
             },
             "webrtc": {
              "type": "boolean"
             },
             "send_diversion": {
              "type": "boolean"
             },
             "send_pai": {
              "type": "boolean"
             },
             "send_rpid": {
              "type": "boolean"
             },
             "remove_existing": {
              "type": "boolean"
             },
             "max_video_streams": {
              "type": "integer"
             },
             "max_audio_streams": {
              "type": "integer"
             },
             "support_path": {
              "type": "boolean"
             },
             "outbound_proxy": {},
             "profile_id": {
              "type": "integer"
             },
             "name": {
              "type": "string"
             },
             "description": {
              "type": "string"
             },
             "default": {
              "type": "boolean"
             },
             "force_avp": {
              "type": "boolean"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/destinations": {
   "get": {
    "tags": [
     "Destinations"
    ],
    "summary": "List destinations",
    "description": "It returns all the destinations categories available on the PBX.",
    "operationId": "get_destinations",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_destination_categories_retrieved": {
          "summary": "200 - Destination Categories Retrieved",
          "value": {
           "status": "success",
           "message": null,
           "data": [
            {
             "id": "1",
             "module": "Extensions"
            },
            {
             "id": "9",
             "module": "Speed Dialing"
            },
            {
             "id": "4",
             "module": "Conferences"
            },
            {
             "id": "5",
             "module": "Custom Applications"
            },
            {
             "id": "6",
             "module": "Custom Destinations"
            },
            {
             "id": "8",
             "module": "Parking"
            },
            {
             "id": "7",
             "module": "Paging & Intercom"
            },
            {
             "id": "13",
             "module": "Ring Groups"
            },
            {
             "id": "14",
             "module": "Queues"
            },
            {
             "id": "15",
             "module": "Queue Priorities"
            },
            {
             "id": "22",
             "module": "Trunks"
            },
            {
             "id": "23",
             "module": "Outbound Routes"
            },
            {
             "id": "31",
             "module": "Inbound Routes"
            },
            {
             "id": "16",
             "module": "IVR"
            },
            {
             "id": "18",
             "module": "Announcements"
            },
            {
             "id": "20",
             "module": "Night Mode"
            },
            {
             "id": "17",
             "module": "Time Conditions"
            },
            {
             "id": "24",
             "module": "Terminate Call"
            },
            {
             "id": "25",
             "module": "Voicemail Direct"
            },
            {
             "id": "26",
             "module": "Voicemail Busy"
            },
            {
             "id": "27",
             "module": "Voicemail Unavailable"
            },
            {
             "id": "28",
             "module": "Follow Me"
            },
            {
             "id": "30",
             "module": "Custom Number"
            },
            {
             "id": "32",
             "module": "Fax Devices"
            },
            {
             "id": "35",
             "module": "Custom Contexts"
            },
            {
             "id": "36",
             "module": "Dynamic Destinations"
            }
           ]
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "string"
             },
             "module": {
              "type": "string"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/destinations/{id}": {
   "get": {
    "tags": [
     "Destinations"
    ],
    "summary": "Get destination",
    "description": "It returns the available destinations for a specific destination category.",
    "operationId": "get_destinations_id",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "Record ID"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_list_destinations": {
          "summary": "200 - List Destinations",
          "value": {
           "status": "success",
           "message": null,
           "data": [
            {
             "destination": "Hangup",
             "id": 1
            },
            {
             "destination": "Congestion",
             "id": 2
            },
            {
             "destination": "Busy",
             "id": 3
            },
            {
             "destination": "Music on Hold",
             "id": 4
            },
            {
             "destination": "Ringback",
             "id": 5
            }
           ]
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "destination": {
              "type": "string"
             },
             "id": {
              "type": "integer"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "examples": {
         "404_destination_category_not_found": {
          "summary": "404 - Destination Category Not Found",
          "value": {
           "status": "not_found",
           "message": "The requested destination doesn't exists",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/extensions": {
   "get": {
    "tags": [
     "Extensions"
    ],
    "summary": "List extensions",
    "description": "Get all extensions and its devices from the PBX filtered by tenant.",
    "operationId": "get_extensions",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "extensions": {
          "summary": "/extensions",
          "value": {
           "status": "success",
           "data": [
            {
             "extension_id": 1,
             "extension": "100",
             "name": "Jhone Doe",
             "language": "en",
             "email": null,
             "class_of_service_id": 1,
             "dial_profile_id": 1,
             "call_limit": 0,
             "internal_cid": "\"Jhone Doe\" <100>",
             "external_cid": "\"Jhone Doe\" <100>",
             "emergency_cid": "\"Jhone Doe\" <100>",
             "ringtime": 0,
             "nospy": false,
             "enabled_pa": false,
             "answermode": "disable",
             "mailbox": "100@mycompany-voicemail",
             "accountcode": null,
             "features_password": "*56437",
             "sendcid": false,
             "generate_hints": false,
             "hot_desking": false,
             "secretary": null,
             "music_group_id": 2,
             "rec_on_demand": false,
             "internal_rec": true,
             "outgoing_rec": true,
             "incoming_rec": true,
             "dictate_enable": false,
             "dictate_format": "ogg",
             "dictate_auto_send": false,
             "fax_enabled": false,
             "fax_auto_send": false,
             "absent_secretary": false,
             "lock": false,
             "call_waiting": false,
             "pinless": false,
             "dynamic_routing": false,
             "tenant_id": 1,
             "context": "cos-all",
             "has_analog_devices": false,
             "devices": [
              {
               "device_id": "3",
               "extension_id": "3",
               "profile_id": "1",
               "user": "100",
               "secret": "100",
               "description": "Jhone Doe",
               "ring_device": "yes",
               "technology": "sip",
               "assigned_exten": "100",
               "tenant_id": "1",
               "device_name": "100"
              }
             ],
             "queues_info": {
              "queues": [
               1
              ],
              "queues_name": [
               "Q500"
              ],
              "queues_penalty": [
               "0"
              ]
             },
             "diversions": {
              "BOSS": "no",
              "PEA": "no",
              "FWM": "no",
              "DND": "no",
              "CC": "no",
              "CFI": "no",
              "CFB": "no",
              "CFN": "no",
              "CFU": "no"
             },
             "sms_number": {
              "id": 4,
              "phone_number": "REDACTED",
              "description": "REDACTED",
              "connection": {
               "id": 4,
               "description": "Provider",
               "provider": "provider"
              }
             }
            }
           ]
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "extension_id": {
              "type": "integer"
             },
             "extension": {
              "type": "string"
             },
             "name": {
              "type": "string"
             },
             "language": {
              "type": "string"
             },
             "email": {},
             "class_of_service_id": {
              "type": "integer"
             },
             "dial_profile_id": {
              "type": "integer"
             },
             "call_limit": {
              "type": "integer"
             },
             "internal_cid": {
              "type": "string"
             },
             "external_cid": {
              "type": "string"
             },
             "emergency_cid": {
              "type": "string"
             },
             "ringtime": {
              "type": "integer"
             },
             "nospy": {
              "type": "boolean"
             },
             "enabled_pa": {
              "type": "boolean"
             },
             "answermode": {
              "type": "string"
             },
             "mailbox": {
              "type": "string"
             },
             "accountcode": {},
             "features_password": {
              "type": "string"
             },
             "sendcid": {
              "type": "boolean"
             },
             "generate_hints": {
              "type": "boolean"
             },
             "hot_desking": {
              "type": "boolean"
             },
             "secretary": {},
             "music_group_id": {
              "type": "integer"
             },
             "rec_on_demand": {
              "type": "boolean"
             },
             "internal_rec": {
              "type": "boolean"
             },
             "outgoing_rec": {
              "type": "boolean"
             },
             "incoming_rec": {
              "type": "boolean"
             },
             "dictate_enable": {
              "type": "boolean"
             },
             "dictate_format": {
              "type": "string"
             },
             "dictate_auto_send": {
              "type": "boolean"
             },
             "fax_enabled": {
              "type": "boolean"
             },
             "fax_auto_send": {
              "type": "boolean"
             },
             "absent_secretary": {
              "type": "boolean"
             },
             "lock": {
              "type": "boolean"
             },
             "call_waiting": {
              "type": "boolean"
             },
             "pinless": {
              "type": "boolean"
             },
             "dynamic_routing": {
              "type": "boolean"
             },
             "tenant_id": {
              "type": "integer"
             },
             "context": {
              "type": "string"
             },
             "has_analog_devices": {
              "type": "boolean"
             },
             "devices": {
              "type": "array",
              "items": {
               "type": "object",
               "properties": {
                "device_id": {
                 "type": "string"
                },
                "extension_id": {
                 "type": "string"
                },
                "profile_id": {
                 "type": "string"
                },
                "user": {
                 "type": "string"
                },
                "secret": {
                 "type": "string"
                },
                "description": {
                 "type": "string"
                },
                "ring_device": {
                 "type": "string"
                },
                "technology": {
                 "type": "string"
                },
                "assigned_exten": {
                 "type": "string"
                },
                "tenant_id": {
                 "type": "string"
                },
                "device_name": {
                 "type": "string"
                }
               }
              }
             },
             "queues_info": {
              "type": "object",
              "properties": {
               "queues": {
                "type": "array",
                "items": {
                 "type": "integer"
                }
               },
               "queues_name": {
                "type": "array",
                "items": {
                 "type": "string"
                }
               },
               "queues_penalty": {
                "type": "array",
                "items": {
                 "type": "string"
                }
               }
              }
             },
             "diversions": {
              "type": "object",
              "properties": {
               "BOSS": {
                "type": "string"
               },
               "PEA": {
                "type": "string"
               },
               "FWM": {
                "type": "string"
               },
               "DND": {
                "type": "string"
               },
               "CC": {
                "type": "string"
               },
               "CFI": {
                "type": "string"
               },
               "CFB": {
                "type": "string"
               },
               "CFN": {
                "type": "string"
               },
               "CFU": {
                "type": "string"
               }
              }
             },
             "sms_number": {
              "type": "object",
              "properties": {
               "id": {
                "type": "integer"
               },
               "phone_number": {
                "type": "string"
               },
               "description": {
                "type": "string"
               },
               "connection": {
                "type": "object",
                "properties": {
                 "id": {
                  "type": "integer"
                 },
                 "description": {
                  "type": "string"
                 },
                 "provider": {
                  "type": "string"
                 }
                }
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/extensions/{extension_id}": {
   "get": {
    "tags": [
     "Extensions"
    ],
    "summary": "Get extension",
    "description": "Get specific extension from server filtered by extension id",
    "operationId": "get_extensions_extension_id",
    "parameters": [
     {
      "name": "extension_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "extension id"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "extensions_id": {
          "summary": "/extensions/{id}",
          "value": {
           "status": "success",
           "data": {
            "extension_id": 63,
            "extension": "2000",
            "name": "Jose Rivera",
            "language": "en",
            "email": "agent@example.com",
            "class_of_service_id": 1,
            "dial_profile_id": 1,
            "ars_id": null,
            "call_limit": 0,
            "internal_cid": "\"Jose Rivera\" <2000>",
            "external_cid": "\"Jose Rivera\" <87669536>",
            "emergency_cid": "\"Etisalna PBX\" <809091>",
            "ringtime": 0,
            "nospy": false,
            "enabled_pa": false,
            "answermode": "disable",
            "mailbox": "2000@mycompany-voicemail",
            "accountcode": "5960859439",
            "features_password": "12345",
            "sendcid": true,
            "generate_hints": false,
            "hot_desking": false,
            "secretary": null,
            "music_group_id": 3,
            "rec_on_demand": false,
            "internal_rec": true,
            "outgoing_rec": true,
            "incoming_rec": true,
            "dictate_enable": false,
            "dictate_format": "ogg",
            "dictate_auto_send": false,
            "fax_enabled": false,
            "fax_auto_send": false,
            "absent_secretary": false,
            "lock": false,
            "call_waiting": false,
            "cid_on_diversions": "caller",
            "pinless": true,
            "dynamic_routing": true,
            "tenant_id": 1,
            "context": "cos-all"
           }
          }
         },
         "200_extension_retrieved": {
          "summary": "200 - Extension retrieved",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "extension_id": 3,
            "extension": "7502",
            "name": "X-Lite",
            "language": "es_NI",
            "email": null,
            "class_of_service_id": 1,
            "dial_profile_id": 1,
            "ars_id": null,
            "call_limit": 0,
            "internal_cid": "\"X-Lite\" <7502>",
            "external_cid": "\"X-Lite\" <7502>",
            "emergency_cid": "\"Telesoft\" <22787050>",
            "ringtime": 0,
            "nospy": false,
            "enabled_pa": false,
            "answermode": "disable",
            "mailbox": "7502@mycompany-voicemail",
            "accountcode": null,
            "features_password": "*56437",
            "sendcid": true,
            "generate_hints": false,
            "hot_desking": false,
            "secretary": null,
            "music_group_id": null,
            "rec_on_demand": false,
            "internal_rec": true,
            "outgoing_rec": true,
            "incoming_rec": true,
            "dictate_enable": false,
            "dictate_format": "ogg",
            "dictate_auto_send": false,
            "fax_enabled": false,
            "fax_auto_send": false,
            "absent_secretary": false,
            "lock": false,
            "call_waiting": false,
            "cid_on_diversions": "callee",
            "pinless": false,
            "dynamic_routing": false,
            "tenant_id": 1,
            "context": "cos-all",
            "has_analog_devices": false,
            "queues_info": {
             "queues": [],
             "queues_name": [],
             "queues_penalty": []
            },
            "devices": [
             {
              "device_id": "3",
              "extension_id": "3",
              "profile_id": "1",
              "user": "dev_7502",
              "secret": "Letacl@2010",
              "description": "X-Lite",
              "ring_device": "yes",
              "technology": "sip",
              "assigned_exten": "7502",
              "tenant_id": "1",
              "device_name": "dev_7502"
             }
            ]
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "extension_id": {
             "type": "integer"
            },
            "extension": {
             "type": "string"
            },
            "name": {
             "type": "string"
            },
            "language": {
             "type": "string"
            },
            "email": {
             "type": "string"
            },
            "class_of_service_id": {
             "type": "integer"
            },
            "dial_profile_id": {
             "type": "integer"
            },
            "ars_id": {},
            "call_limit": {
             "type": "integer"
            },
            "internal_cid": {
             "type": "string"
            },
            "external_cid": {
             "type": "string"
            },
            "emergency_cid": {
             "type": "string"
            },
            "ringtime": {
             "type": "integer"
            },
            "nospy": {
             "type": "boolean"
            },
            "enabled_pa": {
             "type": "boolean"
            },
            "answermode": {
             "type": "string"
            },
            "mailbox": {
             "type": "string"
            },
            "accountcode": {
             "type": "string"
            },
            "features_password": {
             "type": "string"
            },
            "sendcid": {
             "type": "boolean"
            },
            "generate_hints": {
             "type": "boolean"
            },
            "hot_desking": {
             "type": "boolean"
            },
            "secretary": {},
            "music_group_id": {
             "type": "integer"
            },
            "rec_on_demand": {
             "type": "boolean"
            },
            "internal_rec": {
             "type": "boolean"
            },
            "outgoing_rec": {
             "type": "boolean"
            },
            "incoming_rec": {
             "type": "boolean"
            },
            "dictate_enable": {
             "type": "boolean"
            },
            "dictate_format": {
             "type": "string"
            },
            "dictate_auto_send": {
             "type": "boolean"
            },
            "fax_enabled": {
             "type": "boolean"
            },
            "fax_auto_send": {
             "type": "boolean"
            },
            "absent_secretary": {
             "type": "boolean"
            },
            "lock": {
             "type": "boolean"
            },
            "call_waiting": {
             "type": "boolean"
            },
            "cid_on_diversions": {
             "type": "string"
            },
            "pinless": {
             "type": "boolean"
            },
            "dynamic_routing": {
             "type": "boolean"
            },
            "tenant_id": {
             "type": "integer"
            },
            "context": {
             "type": "string"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "examples": {
         "404_extension_not_found": {
          "summary": "404 - Extension not found",
          "value": {
           "status": "not_found",
           "message": "The requested extension doesn't exists",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/extensions/{extension_id}/devices": {
   "get": {
    "tags": [
     "Extensions"
    ],
    "summary": "List devices of an extension",
    "description": "Retrive all devices for a specific extension",
    "operationId": "get_extensions_extension_id_devices",
    "parameters": [
     {
      "name": "extension_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "extension id"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_devices_retrieve": {
          "summary": "200 - Devices retrieve",
          "value": {
           "status": "success",
           "message": null,
           "data": [
            {
             "device_id": "2",
             "extension_id": "2",
             "profile_id": "1",
             "user": "dev-101",
             "secret": "QG4nKqN#BQnNzu",
             "description": "Agent 01",
             "ring_device": "yes",
             "technology": "sip",
             "assigned_exten": null,
             "tenant_id": "1",
             "device_name": "dev-101"
            }
           ]
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "device_id": {
              "type": "string"
             },
             "extension_id": {
              "type": "string"
             },
             "profile_id": {
              "type": "string"
             },
             "user": {
              "type": "string"
             },
             "secret": {
              "type": "string"
             },
             "description": {
              "type": "string"
             },
             "ring_device": {
              "type": "string"
             },
             "technology": {
              "type": "string"
             },
             "assigned_exten": {},
             "tenant_id": {
              "type": "string"
             },
             "device_name": {
              "type": "string"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/extensions/{extension_id}/queues": {
   "get": {
    "tags": [
     "Extensions"
    ],
    "summary": "List queues of an extension",
    "description": "Retrive queues info for an specific extension",
    "operationId": "get_extensions_extension_id_queues",
    "parameters": [
     {
      "name": "extension_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "extension id"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_queues_info_retrieved": {
          "summary": "200 - Queues Info Retrieved",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "queues_id": [
             1,
             2
            ],
            "queues_name": [
             "Q500",
             "Q501"
            ],
            "queues_penalty": [
             "0",
             "0"
            ]
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "object",
           "properties": {
            "queues_id": {
             "type": "array",
             "items": {
              "type": "integer"
             }
            },
            "queues_name": {
             "type": "array",
             "items": {
              "type": "string"
             }
            },
            "queues_penalty": {
             "type": "array",
             "items": {
              "type": "string"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/extensions/{extension_id}/cdr_summary": {
   "get": {
    "tags": [
     "Extensions"
    ],
    "summary": "Call summary of an extension",
    "description": "Get cdr summary from a specific extension",
    "operationId": "get_extensions_extension_id_cdr_summary",
    "parameters": [
     {
      "name": "extension_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "extension id"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_cdr_summary": {
          "summary": "200 - CDR Summary",
          "value": {
           "status": "success",
           "data": {
            "local": "45",
            "incoming": "29",
            "outgoing": "4",
            "transit": "0"
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "local": {
             "type": "string"
            },
            "incoming": {
             "type": "string"
            },
            "outgoing": {
             "type": "string"
            },
            "transit": {
             "type": "string"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/extensions/{extension_id}/voicemail_records": {
   "get": {
    "tags": [
     "Extensions"
    ],
    "summary": "Voicemail messages of an extension",
    "description": "Return all the voicemail records for an specific extension",
    "operationId": "get_extensions_extension_id_voicemail_records",
    "parameters": [
     {
      "name": "extension_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "extension id"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_voicemail_recordings": {
          "summary": "200 - Voicemail Recordings",
          "value": {
           "status": "success",
           "data": {
            "INBOX": {
             "date": "1565987730",
             "clid": "Demo<1519>",
             "priority": "2",
             "vmorig": "2000",
             "duration": "9",
             "recfile": "/static/43b4298b09648469/voicemail/2000/INBOX/msg0000.wav",
             "filename": "msg0000.txt"
            },
            "Old": {
             "date": "1513443087",
             "clid": "X-Lite<7502>",
             "priority": "2",
             "vmorig": "2000",
             "duration": "8",
             "recfile": "/static/43b4298b09648469/voicemail/2000/Old/msg0000.wav",
             "filename": "msg0000.txt"
            }
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "INBOX": {
             "type": "object",
             "properties": {
              "date": {
               "type": "string"
              },
              "clid": {
               "type": "string"
              },
              "priority": {
               "type": "string"
              },
              "vmorig": {
               "type": "string"
              },
              "duration": {
               "type": "string"
              },
              "recfile": {
               "type": "string"
              },
              "filename": {
               "type": "string"
              }
             }
            },
            "Old": {
             "type": "object",
             "properties": {
              "date": {
               "type": "string"
              },
              "clid": {
               "type": "string"
              },
              "priority": {
               "type": "string"
              },
              "vmorig": {
               "type": "string"
              },
              "duration": {
               "type": "string"
              },
              "recfile": {
               "type": "string"
              },
              "filename": {
               "type": "string"
              }
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/outbound_routes": {
   "get": {
    "tags": [
     "Outbound Routes"
    ],
    "summary": "List outbound routes",
    "description": "This endpoint returns all the outbound routes items filtered by tenant.",
    "operationId": "get_outbound_routes",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_retrieve_all_outbound_route_items": {
          "summary": "200 - Retrieve all outbound route items",
          "value": {
           "status": "success",
           "message": null,
           "data": [
            {
             "outbound_route_id": 1,
             "clearyip_connection_id": null,
             "description": "International Calls",
             "pin_list_id": null,
             "destination_id": null,
             "intra_company": false,
             "cid_name": null,
             "cid_number": null,
             "overwrite_cid": "no",
             "clearlyip_route_type": null,
             "record": false,
             "tenant_id": 1,
             "patterns": [
              {
               "prepend": "",
               "prefix": "",
               "pattern": "011.",
               "cid_pattern": ""
              }
             ],
             "trunks": [
              {
               "id": 1,
               "description": "Telnyx"
              },
              {
               "id": 2,
               "description": "Twilio"
              }
             ]
            },
            {
             "outbound_route_id": 2,
             "clearyip_connection_id": null,
             "description": "National Calls",
             "pin_list_id": null,
             "destination_id": null,
             "intra_company": false,
             "cid_name": null,
             "cid_number": null,
             "overwrite_cid": "no",
             "clearlyip_route_type": null,
             "record": false,
             "tenant_id": 1,
             "patterns": [
              {
               "prepend": "",
               "prefix": "",
               "pattern": "1NXXNXXXXXX",
               "cid_pattern": ""
              },
              {
               "prepend": "1",
               "prefix": "",
               "pattern": "NXXNXXXXXX",
               "cid_pattern": ""
              }
             ],
             "trunks": [
              {
               "id": 13,
               "description": "skyetel"
              }
             ]
            }
           ]
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "outbound_route_id": {
              "type": "integer"
             },
             "clearyip_connection_id": {},
             "description": {
              "type": "string"
             },
             "pin_list_id": {},
             "destination_id": {},
             "intra_company": {
              "type": "boolean"
             },
             "cid_name": {},
             "cid_number": {},
             "overwrite_cid": {
              "type": "string"
             },
             "clearlyip_route_type": {},
             "record": {
              "type": "boolean"
             },
             "tenant_id": {
              "type": "integer"
             },
             "patterns": {
              "type": "array",
              "items": {
               "type": "object",
               "properties": {
                "prepend": {
                 "type": "string"
                },
                "prefix": {
                 "type": "string"
                },
                "pattern": {
                 "type": "string"
                },
                "cid_pattern": {
                 "type": "string"
                }
               }
              }
             },
             "trunks": {
              "type": "array",
              "items": {
               "type": "object",
               "properties": {
                "id": {
                 "type": "integer"
                },
                "description": {
                 "type": "string"
                }
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/outbound_routes/{id}": {
   "get": {
    "tags": [
     "Outbound Routes"
    ],
    "summary": "Get outbound route",
    "description": "This endpoint returns a single outbound routes item filtered by ID.",
    "operationId": "get_outbound_routes_id",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "Record ID"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_single_outbound_route_item": {
          "summary": "200 - Single Outbound Route Item",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "outbound_route_id": 1,
            "clearyip_connection_id": null,
            "description": "International Calls",
            "pin_list_id": null,
            "destination_id": null,
            "intra_company": false,
            "cid_name": null,
            "cid_number": null,
            "overwrite_cid": "no",
            "clearlyip_route_type": null,
            "record": false,
            "tenant_id": 1,
            "trunks": [
             {
              "id": 1,
              "description": "Telnxy"
             },
             {
              "id": 2,
              "description": "Twilio"
             }
            ],
            "patterns": [
             {
              "prepend": "",
              "prefix": "",
              "pattern": "011.",
              "cid_pattern": ""
             }
            ]
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "object",
           "properties": {
            "outbound_route_id": {
             "type": "integer"
            },
            "clearyip_connection_id": {},
            "description": {
             "type": "string"
            },
            "pin_list_id": {},
            "destination_id": {},
            "intra_company": {
             "type": "boolean"
            },
            "cid_name": {},
            "cid_number": {},
            "overwrite_cid": {
             "type": "string"
            },
            "clearlyip_route_type": {},
            "record": {
             "type": "boolean"
            },
            "tenant_id": {
             "type": "integer"
            },
            "trunks": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "id": {
                "type": "integer"
               },
               "description": {
                "type": "string"
               }
              }
             }
            },
            "patterns": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "prepend": {
                "type": "string"
               },
               "prefix": {
                "type": "string"
               },
               "pattern": {
                "type": "string"
               },
               "cid_pattern": {
                "type": "string"
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "examples": {
         "404_outbound_route_item_not_found": {
          "summary": "404 - Outbound Route Item not found",
          "value": {
           "status": "not_found",
           "message": "The requested outbound route item doesn't exists",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/parking_lots/{id}": {
   "get": {
    "tags": [
     "Parking Lots"
    ],
    "summary": "Get parking lot",
    "description": "Get an specific parking lot item",
    "operationId": "get_parking_lots_id",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "Record ID"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "parking_lots_id": {
          "summary": "/parking_lots/{id}",
          "value": {
           "status": "success",
           "data": {
            "parking_lot_id": 1,
            "extension": 955,
            "description": "Default Parking",
            "destination_id": 6,
            "parkingtime": 45,
            "comebacktoorigin": true,
            "comebackdialtime": 20,
            "parkedplay": "callee",
            "parkpos": 10,
            "parkedcalltransfers": "no",
            "parkedcallreparking": "no",
            "parkedcallhangup": "no",
            "findslot": "first",
            "music_group_id": 3,
            "defpark": true,
            "announce_space_number": true,
            "tenant_id": 1,
            "parkname": "parking-1"
           }
          }
         },
         "200_retrieve_single_parking_lot": {
          "summary": "200 - Retrieve Single Parking Lot",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "parking_lot_id": 1,
            "extension": 955,
            "description": "Default Parking",
            "destination_id": 6,
            "parkingtime": 45,
            "comebacktoorigin": true,
            "comebackdialtime": 20,
            "parkedplay": "callee",
            "parkpos": 10,
            "parkedcalltransfers": "no",
            "parkedcallreparking": "no",
            "parkedcallhangup": "no",
            "findslot": "first",
            "music_group_id": 3,
            "defpark": true,
            "announce_space_number": true,
            "tenant_id": 1,
            "parkname": "parking-1"
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "parking_lot_id": {
             "type": "integer"
            },
            "extension": {
             "type": "integer"
            },
            "description": {
             "type": "string"
            },
            "destination_id": {
             "type": "integer"
            },
            "parkingtime": {
             "type": "integer"
            },
            "comebacktoorigin": {
             "type": "boolean"
            },
            "comebackdialtime": {
             "type": "integer"
            },
            "parkedplay": {
             "type": "string"
            },
            "parkpos": {
             "type": "integer"
            },
            "parkedcalltransfers": {
             "type": "string"
            },
            "parkedcallreparking": {
             "type": "string"
            },
            "parkedcallhangup": {
             "type": "string"
            },
            "findslot": {
             "type": "string"
            },
            "music_group_id": {
             "type": "integer"
            },
            "defpark": {
             "type": "boolean"
            },
            "announce_space_number": {
             "type": "boolean"
            },
            "tenant_id": {
             "type": "integer"
            },
            "parkname": {
             "type": "string"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "examples": {
         "404_parking_lot_not_found": {
          "summary": "404 - Parking lot not found",
          "value": {
           "status": "not_found",
           "message": "The requested parking lot doesn't exists",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/parking_lots": {
   "get": {
    "tags": [
     "Parking Lots"
    ],
    "summary": "List parking lots",
    "description": "Get all the parking lots items",
    "operationId": "get_parking_lots",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "parking_lots": {
          "summary": "/parking_lots",
          "value": {
           "status": "success",
           "data": [
            {
             "parking_lot_id": 1,
             "extension": 955,
             "description": "Default Parking",
             "destination_id": 6,
             "parkingtime": 45,
             "comebacktoorigin": true,
             "comebackdialtime": 20,
             "parkedplay": "callee",
             "parkpos": 10,
             "parkedcalltransfers": "no",
             "parkedcallreparking": "no",
             "parkedcallhangup": "no",
             "findslot": "first",
             "music_group_id": 3,
             "defpark": true,
             "announce_space_number": true,
             "tenant_id": 1,
             "parkname": "parking-1"
            },
            {
             "parking_lot_id": 2,
             "extension": 800,
             "description": "Demo",
             "destination_id": 7,
             "parkingtime": 45,
             "comebacktoorigin": true,
             "comebackdialtime": 30,
             "parkedplay": "caller",
             "parkpos": 10,
             "parkedcalltransfers": "callee",
             "parkedcallreparking": "no",
             "parkedcallhangup": "no",
             "findslot": "next",
             "music_group_id": 6,
             "defpark": false,
             "announce_space_number": false,
             "tenant_id": 1,
             "parkname": "parking-2"
            }
           ]
          }
         },
         "200_retrieve_all_parking_lots": {
          "summary": "200 - Retrieve all parking lots",
          "value": {
           "status": "success",
           "message": null,
           "data": [
            {
             "parking_lot_id": 1,
             "extension": 955,
             "description": "Default Parking",
             "destination_id": 6,
             "parkingtime": 45,
             "comebacktoorigin": true,
             "comebackdialtime": 20,
             "parkedplay": "callee",
             "parkpos": 10,
             "parkedcalltransfers": "no",
             "parkedcallreparking": "no",
             "parkedcallhangup": "no",
             "findslot": "first",
             "music_group_id": 3,
             "defpark": true,
             "announce_space_number": true,
             "tenant_id": 1,
             "parkname": "parking-1"
            },
            {
             "parking_lot_id": 2,
             "extension": 800,
             "description": "Demo",
             "destination_id": 7,
             "parkingtime": 45,
             "comebacktoorigin": true,
             "comebackdialtime": 30,
             "parkedplay": "caller",
             "parkpos": 10,
             "parkedcalltransfers": "callee",
             "parkedcallreparking": "no",
             "parkedcallhangup": "no",
             "findslot": "next",
             "music_group_id": 6,
             "defpark": false,
             "announce_space_number": false,
             "tenant_id": 1,
             "parkname": "parking-2"
            }
           ]
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "parking_lot_id": {
              "type": "integer"
             },
             "extension": {
              "type": "integer"
             },
             "description": {
              "type": "string"
             },
             "destination_id": {
              "type": "integer"
             },
             "parkingtime": {
              "type": "integer"
             },
             "comebacktoorigin": {
              "type": "boolean"
             },
             "comebackdialtime": {
              "type": "integer"
             },
             "parkedplay": {
              "type": "string"
             },
             "parkpos": {
              "type": "integer"
             },
             "parkedcalltransfers": {
              "type": "string"
             },
             "parkedcallreparking": {
              "type": "string"
             },
             "parkedcallhangup": {
              "type": "string"
             },
             "findslot": {
              "type": "string"
             },
             "music_group_id": {
              "type": "integer"
             },
             "defpark": {
              "type": "boolean"
             },
             "announce_space_number": {
              "type": "boolean"
             },
             "tenant_id": {
              "type": "integer"
             },
             "parkname": {
              "type": "string"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/phonebooks": {
   "get": {
    "tags": [
     "Phone Books"
    ],
    "summary": "List phone books",
    "description": "Get all available phonebooks on the PBX",
    "operationId": "get_phonebooks",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_retrieve_all_phonebooks": {
          "summary": "200 - Retrieve all phonebooks",
          "value": {
           "status": "success",
           "message": null,
           "data": [
            {
             "id": 1,
             "description": "Support Department",
             "source_type": "internal",
             "prefix": null,
             "tenant_id": 1
            },
            {
             "id": 2,
             "description": "Demo",
             "source_type": "internal",
             "prefix": null,
             "tenant_id": 1
            },
            {
             "id": 3,
             "description": "External Phonebook",
             "source_type": "external",
             "prefix": null,
             "tenant_id": 1
            },
            {
             "id": 4,
             "description": "UK Contacts",
             "source_type": "external",
             "prefix": "9",
             "tenant_id": 1
            },
            {
             "id": 5,
             "description": "Testing",
             "source_type": "internal",
             "prefix": null,
             "tenant_id": 1
            }
           ]
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "integer"
             },
             "description": {
              "type": "string"
             },
             "source_type": {
              "type": "string"
             },
             "prefix": {},
             "tenant_id": {
              "type": "integer"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/phonebooks/{id}": {
   "get": {
    "tags": [
     "Phone Books"
    ],
    "summary": "Get phone book",
    "description": "Get a specific phonebook",
    "operationId": "get_phonebooks_id",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "Record ID"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_retrieve_single_phonebook": {
          "summary": "200 - Retrieve single phonebook",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "id": 1,
            "description": "Support Department",
            "source_type": "internal",
            "prefix": null,
            "tenant_id": 1
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "object",
           "properties": {
            "id": {
             "type": "integer"
            },
            "description": {
             "type": "string"
            },
            "source_type": {
             "type": "string"
            },
            "prefix": {},
            "tenant_id": {
             "type": "integer"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "examples": {
         "404_phonebook_doesn_t_exists": {
          "summary": "404 - Phonebook doesn't exists",
          "value": {
           "status": "not_found",
           "message": "The requested phonebook doesn't exists",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/phonebooks/{id}/contacts": {
   "get": {
    "tags": [
     "Phone Books"
    ],
    "summary": "List contacts of a phone book",
    "description": "List the contactas related to an specific phonebook",
    "operationId": "get_phonebooks_id_contacts",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "Record ID"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_retrieve_phonebook_contacts": {
          "summary": "200 - Retrieve phonebook contacts",
          "value": {
           "status": "success",
           "message": null,
           "data": [
            {
             "name": "James Butt",
             "telephone": "5048451427",
             "category": "General"
            },
            {
             "name": "Josephine Darakjy",
             "telephone": "8103749840",
             "category": "General"
            },
            {
             "name": "Art Venere",
             "telephone": "8562644130",
             "category": "General"
            },
            {
             "name": "Lenna Paprocki",
             "telephone": "9079212010",
             "category": "General"
            },
            {
             "name": "Donette Foller",
             "telephone": "5135494561",
             "category": "General"
            },
            {
             "name": "Simona Morasca",
             "telephone": "4198006759",
             "category": "General"
            },
            {
             "name": "Mitsue Tollner",
             "telephone": "7739248565",
             "category": "General"
            },
            {
             "name": "Leota Dilliard",
             "telephone": "4088131105",
             "category": "General"
            },
            {
             "name": "Sage Wieser",
             "telephone": "6057944895",
             "category": "General"
            },
            {
             "name": "Kris Marrier",
             "telephone": "4108044694",
             "category": "General"
            },
            {
             "name": "Minna Amigon",
             "telephone": "2154228694",
             "category": "General"
            },
            {
             "name": "Abel Maclead",
             "telephone": "6316773675",
             "category": "General"
            },
            {
             "name": "Kiley Caldarera",
             "telephone": "3102543084",
             "category": "General"
            },
            {
             "name": "Graciela Ruta",
             "telephone": "4405797763",
             "category": "General"
            },
            {
             "name": "Cammy Albares",
             "telephone": "9568417216",
             "category": "General"
            },
            {
             "name": "Mattie Poquette",
             "telephone": "6029536360",
             "category": "General"
            },
            {
             "name": "Meaghan Garufi",
             "telephone": "9312357959",
             "category": "General"
            },
            {
             "name": "Gladys Rim",
             "telephone": "4143772880",
             "category": "General"
            },
            {
             "name": "Yuki Whobrey",
             "telephone": "3133414470",
             "category": "General"
            },
            {
             "name": "Fletcher Flosi",
             "telephone": "8154265657",
             "category": "General"
            },
            {
             "name": "Bette Nicka",
             "telephone": "6104924643",
             "category": "General"
            },
            {
             "name": "Veronika Inouye",
             "telephone": "4088134592",
             "category": "General"
            },
            {
             "name": "Willard Kolmetz",
             "telephone": "9728964882",
             "category": "General"
            },
            {
             "name": "Maryann Royster",
             "telephone": "5184488982",
             "category": "General"
            },
            {
             "name": "Alisha Slusarski",
             "telephone": "7326353453",
             "category": "General"
            },
            {
             "name": "Allene Iturbide",
             "telephone": "7155309863",
             "category": "General"
            },
            {
             "name": "Chanel Caudy",
             "telephone": "9138991103",
             "category": "General"
            },
            {
             "name": "Ezekiel Chui",
             "telephone": "4102358738",
             "category": "General"
            },
            {
             "name": "Willow Kusko",
             "telephone": "2129345167",
             "category": "General"
            },
            {
             "name": "Bernardo Figeroa",
             "telephone": "9365973614",
             "category": "General"
            },
            {
             "name": "Ammie Corrio",
             "telephone": "6146483265",
             "category": "General"
            },
            {
             "name": "Francine Vocelka",
             "telephone": "5053355293",
             "category": "General"
            },
            {
             "name": "Ernie Stenseth",
             "telephone": "2013879093",
             "category": "General"
            },
            {
             "name": "Albina Glick",
             "telephone": "7327826701",
             "category": "General"
            },
            {
             "name": "Alishia Sergi",
             "telephone": "2127532740",
             "category": "General"
            },
            {
             "name": "Solange Shinko",
             "telephone": "5042658174",
             "category": "General"
            },
            {
             "name": "Jose Stockham",
             "telephone": "2125694233",
             "category": "General"
            },
            {
             "name": "Rozella Ostrosky",
             "telephone": "8056091531",
             "category": "General"
            },
            {
             "name": "Valentine Gillian",
             "telephone": "2103006244",
             "category": "General"
            },
            {
             "name": "Kati Rulapaugh",
             "telephone": "7852197724",
             "category": "General"
            },
            {
             "name": "Youlanda Schemmer",
             "telephone": "5419932611",
             "category": "General"
            },
            {
             "name": "Dyan Oldroyd",
             "telephone": "9136458918",
             "category": "General"
            },
            {
             "name": "Roxane Campain",
             "telephone": "9073356568",
             "category": "General"
            },
            {
             "name": "Lavera Perin",
             "telephone": "3059952078",
             "category": "General"
            },
            {
             "name": "Erick Ferencz",
             "telephone": "9072276777",
             "category": "General"
            },
            {
             "name": "Fatima Saylors",
             "telephone": "9524792375",
             "category": "General"
            },
            {
             "name": "Jina Briddick",
             "telephone": "6179975771",
             "category": "General"
            },
            {
             "name": "Kanisha Waycott",
             "telephone": "3233157314",
             "category": "General"
            },
            {
             "name": "Emerson Bowley",
             "telephone": "6086587940",
             "category": "General"
            },
            {
             "name": "Blair Malet",
             "telephone": "2157944519",
             "category": "General"
            },
            {
             "name": "Brock Bolognia",
             "telephone": "2126175063",
             "category": "General"
            },
            {
             "name": "Lorrie Nestle",
             "telephone": "9313036041",
             "category": "General"
            },
            {
             "name": "Sabra Uyetake",
             "telephone": "8036813678",
             "category": "General"
            },
            {
             "name": "Marjory Mastella",
             "telephone": "6103797125",
             "category": "General"
            },
            {
             "name": "Karl Klonowski",
             "telephone": "9084704661",
             "category": "General"
            },
            {
             "name": "Tonette Wenner",
             "telephone": "5163334861",
             "category": "General"
            },
            {
             "name": "Amber Monarrez",
             "telephone": "2153296386",
             "category": "General"
            },
            {
             "name": "Shenika Seewald",
             "telephone": "8187498650",
             "category": "General"
            },
            {
             "name": "Delmy Ahle",
             "telephone": "4015598961",
             "category": "General"
            },
            {
             "name": "Deeanna Juhas",
             "telephone": "2154179563",
             "category": "General"
            },
            {
             "name": "Blondell Pugh",
             "telephone": "4013008122",
             "category": "General"
            },
            {
             "name": "Jamal Vanausdal",
             "telephone": "7329042931",
             "category": "General"
            },
            {
             "name": "Cecily Hollack",
             "telephone": "5128613814",
             "category": "General"
            },
            {
             "name": "Carmelina Lindall",
             "telephone": "3038745160",
             "category": "General"
            },
            {
             "name": "Maurine Yglesias",
             "telephone": "4145737719",
             "category": "General"
            },
            {
             "name": "Tawna Buvens",
             "telephone": "2124629157",
             "category": "General"
            },
            {
             "name": "Penney Weight",
             "telephone": "9078732882",
             "category": "General"
            },
            {
             "name": "Elly Morocco",
             "telephone": "8144203553",
             "category": "General"
            },
            {
             "name": "Ilene Eroman",
             "telephone": "4109374543",
             "category": "General"
            },
            {
             "name": "Vallie Mondella",
             "telephone": "2087378439",
             "category": "General"
            },
            {
             "name": "Kallie Blackwood",
             "telephone": "4156047609",
             "category": "General"
            },
            {
             "name": "Johnetta Abdallah",
             "telephone": "9197153791",
             "category": "General"
            },
            {
             "name": "Bobbye Rhym",
             "telephone": "6508119032",
             "category": "General"
            },
            {
             "name": "Micaela Rhymes",
             "telephone": "9255227798",
             "category": "General"
            },
            {
             "name": "Tamar Hoogland",
             "telephone": "7405265410",
             "category": "General"
            },
            {
             "name": "Moon Parlato",
             "telephone": "5854984278",
             "category": "General"
            },
            {
             "name": "Laurel Reitler",
             "telephone": "4109576903",
             "category": "General"
            },
            {
             "name": "Delisa Crupi",
             "telephone": "9738479611",
             "category": "General"
            },
            {
             "name": "Viva Toelkes",
             "telephone": "7733523437",
             "category": "General"
            },
            {
             "name": "Elza Lipke",
             "telephone": "9737963667",
             "category": "General"
            },
            {
             "name": "Devorah Chickering",
             "telephone": "5059501763",
             "category": "General"
            },
            {
             "name": "Timothy Mulqueen",
             "telephone": "7186547063",
             "category": "General"
            },
            {
             "name": "Arlette Honeywell",
             "telephone": "9045149918",
             "category": "General"
            },
            {
             "name": "Dominque Dickerson",
             "telephone": "5109017640",
             "category": "General"
            },
            {
             "name": "Lettie Isenhower",
             "telephone": "2167338494",
             "category": "General"
            },
            {
             "name": "Myra Munns",
             "telephone": "8174513518",
             "category": "General"
            },
            {
             "name": "Stephaine Barfield",
             "telephone": "3109681219",
             "category": "General"
            },
            {
             "name": "Lai Gato",
             "telephone": "8479574614",
             "category": "General"
            },
            {
             "name": "Stephen Emigh",
             "telephone": "3307002312",
             "category": "General"
            },
            {
             "name": "Tyra Shields",
             "telephone": "2152288264",
             "category": "General"
            },
            {
             "name": "Tammara Wardrip",
             "telephone": "6502165075",
             "category": "General"
            },
            {
             "name": "Cory Gibes",
             "telephone": "6266962777",
             "category": "General"
            },
            {
             "name": "Danica Bruschke",
             "telephone": "2542051422",
             "category": "General"
            },
            {
             "name": "Wilda Giguere",
             "telephone": "9079149482",
             "category": "General"
            },
            {
             "name": "Elvera Benimadho",
             "telephone": "4084408447",
             "category": "General"
            },
            {
             "name": "Carma Vanheusen",
             "telephone": "5104524835",
             "category": "General"
            },
            {
             "name": "Malinda Hochard",
             "telephone": "3174722412",
             "category": "General"
            },
            {
             "name": "Natalie Fern",
             "telephone": "3072793793",
             "category": "General"
            },
            {
             "name": "Lisha Centini",
             "telephone": "7034757568",
             "category": "General"
            },
            {
             "name": "Jose Rivera",
             "telephone": "+13055605776",
             "category": "General"
            },
            {
             "name": "Jose Montes",
             "telephone": "17056502345",
             "category": "General"
            }
           ]
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "name": {
              "type": "string"
             },
             "telephone": {
              "type": "string"
             },
             "category": {
              "type": "string"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "examples": {
         "400_invalid_phone_book": {
          "summary": "400 - Invalid Phone Book",
          "value": {
           "status": "validation",
           "message": "The provided phonebook ID doesn't exists",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/queues": {
   "get": {
    "tags": [
     "Queues"
    ],
    "summary": "List queues",
    "description": "Retrive all queues by tenant",
    "operationId": "get_queues",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_queues": {
          "summary": "200 - Queues",
          "value": {
           "status": "success",
           "message": null,
           "data": [
            {
             "queue_id": 1,
             "extension": 500,
             "queue_vip_list_id": null,
             "ivr_id": null,
             "queue_callback_id": 1,
             "cron_profile_id": 1,
             "description": "Support Calls",
             "prefix": "Support:",
             "destination_id": 9,
             "hangup_destination_id": null,
             "strategy": "random",
             "music_group_id": null,
             "weight": null,
             "autofill": true,
             "maxlen": 0,
             "announcement_id": null,
             "periodic_announcement_id": 1,
             "join_announcement_id": null,
             "record": true,
             "servicelevel": 10,
             "wrapuptime": 0,
             "announce_frequency": null,
             "min_announce_frequency": null,
             "periodic_announce_frequency": "10",
             "announce_round_seconds": "0",
             "announce_to_first_user": false,
             "announce_position": "no",
             "announce_position_limit": null,
             "relative_periodic_announce": true,
             "announce_holdtime": false,
             "penaltymemberslimit": null,
             "autopause": "no",
             "ringinuse": false,
             "memberdelay": null,
             "timeoutrestart": false,
             "joinempty": "yes",
             "timeoutpriority": "app",
             "timeout": 10,
             "queue_timeout": null,
             "leavewhenempty": "no",
             "retry": 5,
             "tenant_id": 1,
             "name": "Q500",
             "answered_elsewhere": true,
             "agents_context": "queue-call-to-agents",
             "members": [
              {
               "extension": "2001",
               "interface": "Local/2001@queue-call-to-agents/n",
               "extension_id": 243,
               "penalty": 0,
               "diversions": true,
               "type": "dynamic"
              },
              {
               "extension": "2002",
               "interface": "Local/2002@queue-call-to-agents/n",
               "extension_id": 244,
               "penalty": 0,
               "diversions": false,
               "type": "dynamic"
              }
             ]
            },
            {
             "queue_id": 2,
             "extension": 501,
             "queue_vip_list_id": null,
             "ivr_id": 1,
             "queue_callback_id": null,
             "cron_profile_id": null,
             "description": "Sales",
             "prefix": null,
             "destination_id": 10,
             "hangup_destination_id": null,
             "strategy": "ringall",
             "music_group_id": null,
             "weight": null,
             "autofill": true,
             "maxlen": 0,
             "announcement_id": null,
             "periodic_announcement_id": 1,
             "join_announcement_id": null,
             "record": true,
             "servicelevel": 20,
             "wrapuptime": 0,
             "announce_frequency": null,
             "min_announce_frequency": null,
             "periodic_announce_frequency": null,
             "announce_round_seconds": "0",
             "announce_to_first_user": false,
             "announce_position": "no",
             "announce_position_limit": null,
             "relative_periodic_announce": false,
             "announce_holdtime": false,
             "penaltymemberslimit": null,
             "autopause": "no",
             "ringinuse": false,
             "memberdelay": null,
             "timeoutrestart": false,
             "joinempty": "yes",
             "timeoutpriority": "app",
             "timeout": 15,
             "queue_timeout": 10,
             "leavewhenempty": "no",
             "retry": 5,
             "tenant_id": 1,
             "name": "Q501",
             "answered_elsewhere": false,
             "agents_context": "queue-call-to-agents",
             "members": [
              {
               "extension": "2001",
               "interface": "Local/2001@queue-call-to-agents/n",
               "extension_id": 243,
               "penalty": 0,
               "diversions": false,
               "type": "dynamic"
              }
             ]
            },
            {
             "queue_id": 4,
             "extension": 504,
             "queue_vip_list_id": null,
             "ivr_id": null,
             "queue_callback_id": null,
             "cron_profile_id": 1,
             "description": "Support Calls 2",
             "prefix": null,
             "destination_id": 12,
             "hangup_destination_id": null,
             "strategy": "ringall",
             "music_group_id": 1,
             "weight": null,
             "autofill": false,
             "maxlen": 0,
             "announcement_id": null,
             "periodic_announcement_id": 1,
             "join_announcement_id": null,
             "record": true,
             "servicelevel": null,
             "wrapuptime": 0,
             "announce_frequency": null,
             "min_announce_frequency": null,
             "periodic_announce_frequency": null,
             "announce_round_seconds": "0",
             "announce_to_first_user": false,
             "announce_position": "no",
             "announce_position_limit": null,
             "relative_periodic_announce": false,
             "announce_holdtime": false,
             "penaltymemberslimit": null,
             "autopause": "no",
             "ringinuse": false,
             "memberdelay": null,
             "timeoutrestart": false,
             "joinempty": "yes",
             "timeoutpriority": "app",
             "timeout": 15,
             "queue_timeout": 10,
             "leavewhenempty": "no",
             "retry": 5,
             "tenant_id": 1,
             "name": "Q504",
             "answered_elsewhere": false,
             "agents_context": "queue-call-to-agents",
             "members": [
              {
               "extension": "2000",
               "interface": "Local/2000@queue-call-to-agents/n",
               "extension_id": 63,
               "penalty": 0,
               "diversions": false,
               "type": "dynamic"
              }
             ]
            }
           ]
          }
         },
         "queues": {
          "summary": "/queues",
          "value": {
           "status": "success",
           "data": [
            {
             "queue_id": 1,
             "extension": 500,
             "queue_vip_list_id": null,
             "ivr_id": null,
             "queue_callback_id": 1,
             "cron_profile_id": 1,
             "description": "Support Calls",
             "prefix": "Support:",
             "destination_id": 9,
             "hangup_destination_id": null,
             "strategy": "random",
             "music_group_id": null,
             "weight": null,
             "autofill": true,
             "maxlen": 0,
             "announcement_id": null,
             "periodic_announcement_id": 1,
             "join_announcement_id": null,
             "record": true,
             "servicelevel": 10,
             "wrapuptime": 0,
             "announce_frequency": null,
             "min_announce_frequency": null,
             "periodic_announce_frequency": "10",
             "announce_round_seconds": "0",
             "announce_to_first_user": false,
             "announce_position": "no",
             "announce_position_limit": null,
             "relative_periodic_announce": true,
             "announce_holdtime": false,
             "penaltymemberslimit": null,
             "autopause": "no",
             "ringinuse": false,
             "memberdelay": null,
             "timeoutrestart": false,
             "joinempty": "yes",
             "timeoutpriority": "app",
             "timeout": 10,
             "queue_timeout": 30,
             "leavewhenempty": "no",
             "retry": 5,
             "tenant_id": 1,
             "name": "Q500",
             "answered_elsewhere": true,
             "agents_context": "queue-call-to-agents",
             "members": [
              {
               "queue_member_id": "93",
               "queue_id": "1",
               "extension_id": "243",
               "penalty": "0",
               "diversions": "no",
               "type": "dynamic",
               "extension": "2001",
               "name": "Person 01"
              },
              {
               "queue_member_id": "95",
               "queue_id": "1",
               "extension_id": "244",
               "penalty": "0",
               "diversions": "no",
               "type": "dynamic",
               "extension": "2002",
               "name": "Person 02"
              }
             ]
            },
            {
             "queue_id": 2,
             "extension": 501,
             "queue_vip_list_id": null,
             "ivr_id": 1,
             "queue_callback_id": null,
             "cron_profile_id": null,
             "description": "Sales",
             "prefix": null,
             "destination_id": 10,
             "hangup_destination_id": null,
             "strategy": "ringall",
             "music_group_id": null,
             "weight": null,
             "autofill": true,
             "maxlen": 0,
             "announcement_id": null,
             "periodic_announcement_id": 1,
             "join_announcement_id": null,
             "record": true,
             "servicelevel": 20,
             "wrapuptime": 0,
             "announce_frequency": null,
             "min_announce_frequency": null,
             "periodic_announce_frequency": null,
             "announce_round_seconds": "0",
             "announce_to_first_user": false,
             "announce_position": "no",
             "announce_position_limit": null,
             "relative_periodic_announce": false,
             "announce_holdtime": false,
             "penaltymemberslimit": null,
             "autopause": "no",
             "ringinuse": false,
             "memberdelay": null,
             "timeoutrestart": false,
             "joinempty": "yes",
             "timeoutpriority": "app",
             "timeout": 15,
             "queue_timeout": 10,
             "leavewhenempty": "no",
             "retry": 5,
             "tenant_id": 1,
             "name": "Q501",
             "answered_elsewhere": false,
             "agents_context": "queue-call-to-agents",
             "members": [
              {
               "queue_member_id": "89",
               "queue_id": "2",
               "extension_id": "243",
               "penalty": "0",
               "diversions": "no",
               "type": "dynamic",
               "extension": "2001",
               "name": "Person 01"
              }
             ]
            },
            {
             "queue_id": 4,
             "extension": 504,
             "queue_vip_list_id": null,
             "ivr_id": null,
             "queue_callback_id": null,
             "cron_profile_id": 1,
             "description": "Support Calls 2",
             "prefix": null,
             "destination_id": 12,
             "hangup_destination_id": null,
             "strategy": "ringall",
             "music_group_id": 1,
             "weight": null,
             "autofill": false,
             "maxlen": 0,
             "announcement_id": null,
             "periodic_announcement_id": 1,
             "join_announcement_id": null,
             "record": true,
             "servicelevel": null,
             "wrapuptime": 0,
             "announce_frequency": null,
             "min_announce_frequency": null,
             "periodic_announce_frequency": null,
             "announce_round_seconds": "0",
             "announce_to_first_user": false,
             "announce_position": "no",
             "announce_position_limit": null,
             "relative_periodic_announce": false,
             "announce_holdtime": false,
             "penaltymemberslimit": null,
             "autopause": "no",
             "ringinuse": false,
             "memberdelay": null,
             "timeoutrestart": false,
             "joinempty": "yes",
             "timeoutpriority": "app",
             "timeout": 15,
             "queue_timeout": 10,
             "leavewhenempty": "no",
             "retry": 5,
             "tenant_id": 1,
             "name": "Q504",
             "answered_elsewhere": false,
             "agents_context": "queue-call-to-agents",
             "members": [
              {
               "queue_member_id": "94",
               "queue_id": "4",
               "extension_id": "63",
               "penalty": "0",
               "diversions": "no",
               "type": "dynamic",
               "extension": "2000",
               "name": "Jose Rivera"
              }
             ]
            }
           ]
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "queue_id": {
              "type": "integer"
             },
             "extension": {
              "type": "integer"
             },
             "queue_vip_list_id": {},
             "ivr_id": {},
             "queue_callback_id": {
              "type": "integer"
             },
             "cron_profile_id": {
              "type": "integer"
             },
             "description": {
              "type": "string"
             },
             "prefix": {
              "type": "string"
             },
             "destination_id": {
              "type": "integer"
             },
             "hangup_destination_id": {},
             "strategy": {
              "type": "string"
             },
             "music_group_id": {},
             "weight": {},
             "autofill": {
              "type": "boolean"
             },
             "maxlen": {
              "type": "integer"
             },
             "announcement_id": {},
             "periodic_announcement_id": {
              "type": "integer"
             },
             "join_announcement_id": {},
             "record": {
              "type": "boolean"
             },
             "servicelevel": {
              "type": "integer"
             },
             "wrapuptime": {
              "type": "integer"
             },
             "announce_frequency": {},
             "min_announce_frequency": {},
             "periodic_announce_frequency": {
              "type": "string"
             },
             "announce_round_seconds": {
              "type": "string"
             },
             "announce_to_first_user": {
              "type": "boolean"
             },
             "announce_position": {
              "type": "string"
             },
             "announce_position_limit": {},
             "relative_periodic_announce": {
              "type": "boolean"
             },
             "announce_holdtime": {
              "type": "boolean"
             },
             "penaltymemberslimit": {},
             "autopause": {
              "type": "string"
             },
             "ringinuse": {
              "type": "boolean"
             },
             "memberdelay": {},
             "timeoutrestart": {
              "type": "boolean"
             },
             "joinempty": {
              "type": "string"
             },
             "timeoutpriority": {
              "type": "string"
             },
             "timeout": {
              "type": "integer"
             },
             "queue_timeout": {},
             "leavewhenempty": {
              "type": "string"
             },
             "retry": {
              "type": "integer"
             },
             "tenant_id": {
              "type": "integer"
             },
             "name": {
              "type": "string"
             },
             "answered_elsewhere": {
              "type": "boolean"
             },
             "agents_context": {
              "type": "string"
             },
             "members": {
              "type": "array",
              "items": {
               "type": "object",
               "properties": {
                "extension": {
                 "type": "string"
                },
                "interface": {
                 "type": "string"
                },
                "extension_id": {
                 "type": "integer"
                },
                "penalty": {
                 "type": "integer"
                },
                "diversions": {
                 "type": "boolean"
                },
                "type": {
                 "type": "string"
                }
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   },
   "post": {
    "tags": [
     "Queues"
    ],
    "summary": "Create queue",
    "description": "This endpoint allows you to create queues with all the required parameters. There are some missed endpoints required for some fields(Announcements, Music on Hold, etc.). Nonetheless, the current implementation allows you to create functional queues.\n\n| Option Name | Type | Default Value | Description |\n| --- | --- | --- | --- |\n| **extension** | String |  | Extension number to reach the queue. |\n| **description** | String |  | Short description to identify the queue. |\n| **prefix** | String |  | Prefix to append to calls in a queue. It typically indicates to the agents from which queue the call comes. |\n| **direction** | String | inbound | It defines the type of call direction for a queue. This parameter is only available through API, and its possible values are \"**inbound**\" and \"**outbound**.\" |\n| **dial_mode** | String |  | It defines the mode for outbound dialing. This parameter is only available through API and specially created for the Dialer module. |\n| **strategy** | String | rrordered | It defines the ring strategy to dial the members of a queue. Possible values are: fewestcalls, leastrecent, linear, random, ringall, rrmemory, rrordered, wrandom. More info about the meaning of each parameter in this link. |\n| **weight** | Integer | 0 | Short description to identify the queue. |\n| **servicelevel** | Integer | 30 | Used in statistics to determine the service level of the queue (calls answered within the service level time frame). |\n| **wrapuptime** | Integer | 0 | The number of seconds to keep a member unavailable in a queue after completing a call. |\n| **joinempty** | String | yes | Controls whether a caller is added to the queue when no members are available. Possible values are: loose, no, no_inuse, strict, and yes. |\n| **leavewhenempty** | String | no | Used to control whether callers are kicked out of the queue when members are no longer available to take calls. Possible values are: loose, no, no_inuse, strict, and yes. |\n| **timeoutpriority** | String | app | Used to control the priority of the two possible timeout options specified for a queue. Possible values are: app and conf. |\n| **queue_timeout** | Integer | 0 | It will cause the queue to fail out after a specified number of seconds. Setting up this parameter to zero will disable the queue timeout. |\n| **timeout** | Integer | 15 | It specifies the number of seconds to ring a member's device. |\n| **retry** | Integer | 5 | It specifies the number of seconds to wait before attempting the next member in the queue if the timeout value is exhausted while attempting to ring a member of the queue |\n| **alertinfo** | String |  | It allows you to define an Alert-Info Header for generating a distinctive ringtone on members' devices associated with a queue. |\n| **autofill** | Boolean | true | The old behavior of the queue (autofill=no) is to have a serial type behavior in that the queue will make all waiting callers wait in the queue even if there is more than one available member ready to take calls until the head caller is connected with the member they were trying to get to. |\n| **memberdelay** | Integer |  | Used if you want a delay prior to the caller and queue member being connected to each other. |\n| **autopause** | String |  | It Enables/disables the automatic pausing of members who fail to answer a call. Possible values are: All, No, and Yes. More info about this parameter in this link. |\n| **ringinuse** | Boolean | false | It allows defining if busy agents will receive calls when they are busy. |\n| **record** | Boolean | false | It allows defining if calls on a queue will get recorded or not. |\n| **timeoutrestart** | Boolean | false | Setting up this parameter to true will reset the timeout for an agent to answer if either a BUSY or CONGESTION status is received from the channel; this can be useful if the agents are allowed to reject or cancel a call. |\n| **answered_elsewhere** | Boolean | false | Mark all calls as \"answered elsewhere\" when cancelled. This avoids a missed call on the phone if it supports it. |\n| **members** | Array |  | Array with the members of a queue. The \"extension_id\" attribute is the only required parameter for each member. |\n| **final_destination** | Object |  | The destination to execute after reaching the queue timeout. The object must contain the destination category's id and the destination's id. You can get the values for this parameter from the destinations' endpoints. |\n| **after_hangup_destination** | Object |  | The destination to execute after the agent hanged up; this is useful to run a survey to rate the customer service, for instance. The object must contain the destination category's id and the destination's id. You can get the values for this parameter from the destinations' endpoints. |",
    "operationId": "post_queues",
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "extension": {
          "type": "integer"
         },
         "queue_vip_list_id": {},
         "ivr_id": {},
         "queue_callback_id": {},
         "cron_profile_id": {},
         "description": {
          "type": "string"
         },
         "prefix": {},
         "direction": {
          "type": "string"
         },
         "dial_mode": {},
         "strategy": {
          "type": "string"
         },
         "music_group_id": {
          "type": "integer"
         },
         "weight": {
          "type": "integer"
         },
         "autofill": {
          "type": "boolean"
         },
         "maxlen": {
          "type": "integer"
         },
         "announcement_id": {},
         "periodic_announcement_id": {
          "type": "integer"
         },
         "join_announcement_id": {},
         "record": {
          "type": "boolean"
         },
         "servicelevel": {
          "type": "integer"
         },
         "wrapuptime": {
          "type": "integer"
         },
         "announce_frequency": {},
         "min_announce_frequency": {},
         "periodic_announce_frequency": {
          "type": "integer"
         },
         "announce_round_seconds": {
          "type": "integer"
         },
         "announce_to_first_user": {
          "type": "boolean"
         },
         "announce_position": {
          "type": "string"
         },
         "announce_position_limit": {},
         "relative_periodic_announce": {
          "type": "boolean"
         },
         "announce_holdtime": {
          "type": "boolean"
         },
         "penaltymemberslimit": {},
         "autopause": {
          "type": "string"
         },
         "ringinuse": {
          "type": "boolean"
         },
         "ring_unavailable": {
          "type": "boolean"
         },
         "memberdelay": {},
         "timeoutrestart": {
          "type": "boolean"
         },
         "joinempty": {
          "type": "string"
         },
         "timeoutpriority": {
          "type": "string"
         },
         "timeout": {
          "type": "integer"
         },
         "queue_timeout": {
          "type": "integer"
         },
         "leavewhenempty": {
          "type": "string"
         },
         "retry": {
          "type": "integer"
         },
         "answered_elsewhere": {
          "type": "boolean"
         },
         "alertinfo": {},
         "answerchannel": {
          "type": "boolean"
         },
         "members": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "extension_id": {
             "type": "integer"
            },
            "penalty": {
             "type": "integer"
            },
            "diversions": {
             "type": "boolean"
            },
            "type": {
             "type": "string"
            }
           }
          }
         },
         "final_destination": {
          "type": "object",
          "properties": {
           "cetegory_id": {
            "type": "integer"
           },
           "destination_id": {
            "type": "integer"
           }
          }
         },
         "after_hangup_destination": {
          "type": "object",
          "properties": {
           "cetegory_id": {},
           "destination_id": {}
          }
         }
        }
       },
       "example": {
        "extension": 510,
        "queue_vip_list_id": null,
        "ivr_id": null,
        "queue_callback_id": null,
        "cron_profile_id": null,
        "description": "Partners",
        "prefix": null,
        "direction": "inbound",
        "dial_mode": null,
        "strategy": "rrordered",
        "music_group_id": 1,
        "weight": 0,
        "autofill": true,
        "maxlen": 0,
        "announcement_id": null,
        "periodic_announcement_id": 1,
        "join_announcement_id": null,
        "record": false,
        "servicelevel": 30,
        "wrapuptime": 0,
        "announce_frequency": null,
        "min_announce_frequency": null,
        "periodic_announce_frequency": 15,
        "announce_round_seconds": 0,
        "announce_to_first_user": false,
        "announce_position": "no",
        "announce_position_limit": null,
        "relative_periodic_announce": false,
        "announce_holdtime": false,
        "penaltymemberslimit": null,
        "autopause": "no",
        "ringinuse": false,
        "ring_unavailable": false,
        "memberdelay": null,
        "timeoutrestart": false,
        "joinempty": "yes",
        "timeoutpriority": "app",
        "timeout": 15,
        "queue_timeout": 0,
        "leavewhenempty": "no",
        "retry": 5,
        "answered_elsewhere": false,
        "alertinfo": null,
        "answerchannel": true,
        "members": [
         {
          "extension_id": 288,
          "penalty": 0,
          "diversions": true,
          "type": "dynamic"
         },
         {
          "extension_id": 6374,
          "penalty": 0,
          "diversions": true,
          "type": "dynamic"
         }
        ],
        "final_destination": {
         "cetegory_id": 24,
         "destination_id": 1
        },
        "after_hangup_destination": {
         "cetegory_id": null,
         "destination_id": null
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_queue_created": {
          "summary": "200 - Queue Created",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "queue_id": 9,
            "extension": 510,
            "queue_vip_list_id": null,
            "ivr_id": null,
            "queue_callback_id": null,
            "cron_profile_id": null,
            "description": "Partners",
            "prefix": null,
            "direction": "inbound",
            "dial_mode": null,
            "destination_id": 423,
            "hangup_destination_id": null,
            "strategy": "rrordered",
            "music_group_id": 1,
            "weight": 0,
            "autofill": true,
            "maxlen": 0,
            "announcement_id": null,
            "periodic_announcement_id": 1,
            "join_announcement_id": null,
            "record": false,
            "servicelevel": 30,
            "wrapuptime": 0,
            "announce_frequency": null,
            "min_announce_frequency": null,
            "periodic_announce_frequency": "15",
            "announce_round_seconds": "0",
            "announce_to_first_user": false,
            "announce_position": "no",
            "announce_position_limit": null,
            "relative_periodic_announce": false,
            "announce_holdtime": false,
            "penaltymemberslimit": null,
            "autopause": "no",
            "ringinuse": false,
            "memberdelay": null,
            "timeoutrestart": false,
            "joinempty": "yes",
            "timeoutpriority": "app",
            "timeout": 15,
            "queue_timeout": 0,
            "leavewhenempty": "no",
            "retry": 5,
            "tenant_id": 1,
            "name": "Q510",
            "answered_elsewhere": false,
            "agents_context": "queue-call-to-agents",
            "alertinfo": null,
            "answerchannel": true,
            "members": [
             {
              "member_id": 41,
              "extension_id": 288,
              "penalty": 0,
              "diversions": true,
              "type": "dynamic"
             },
             {
              "member_id": 42,
              "extension_id": 6374,
              "penalty": 0,
              "diversions": true,
              "type": "dynamic"
             }
            ]
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "object",
           "properties": {
            "queue_id": {
             "type": "integer"
            },
            "extension": {
             "type": "integer"
            },
            "queue_vip_list_id": {},
            "ivr_id": {},
            "queue_callback_id": {},
            "cron_profile_id": {},
            "description": {
             "type": "string"
            },
            "prefix": {},
            "direction": {
             "type": "string"
            },
            "dial_mode": {},
            "destination_id": {
             "type": "integer"
            },
            "hangup_destination_id": {},
            "strategy": {
             "type": "string"
            },
            "music_group_id": {
             "type": "integer"
            },
            "weight": {
             "type": "integer"
            },
            "autofill": {
             "type": "boolean"
            },
            "maxlen": {
             "type": "integer"
            },
            "announcement_id": {},
            "periodic_announcement_id": {
             "type": "integer"
            },
            "join_announcement_id": {},
            "record": {
             "type": "boolean"
            },
            "servicelevel": {
             "type": "integer"
            },
            "wrapuptime": {
             "type": "integer"
            },
            "announce_frequency": {},
            "min_announce_frequency": {},
            "periodic_announce_frequency": {
             "type": "string"
            },
            "announce_round_seconds": {
             "type": "string"
            },
            "announce_to_first_user": {
             "type": "boolean"
            },
            "announce_position": {
             "type": "string"
            },
            "announce_position_limit": {},
            "relative_periodic_announce": {
             "type": "boolean"
            },
            "announce_holdtime": {
             "type": "boolean"
            },
            "penaltymemberslimit": {},
            "autopause": {
             "type": "string"
            },
            "ringinuse": {
             "type": "boolean"
            },
            "memberdelay": {},
            "timeoutrestart": {
             "type": "boolean"
            },
            "joinempty": {
             "type": "string"
            },
            "timeoutpriority": {
             "type": "string"
            },
            "timeout": {
             "type": "integer"
            },
            "queue_timeout": {
             "type": "integer"
            },
            "leavewhenempty": {
             "type": "string"
            },
            "retry": {
             "type": "integer"
            },
            "tenant_id": {
             "type": "integer"
            },
            "name": {
             "type": "string"
            },
            "answered_elsewhere": {
             "type": "boolean"
            },
            "agents_context": {
             "type": "string"
            },
            "alertinfo": {},
            "answerchannel": {
             "type": "boolean"
            },
            "members": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "member_id": {
                "type": "integer"
               },
               "extension_id": {
                "type": "integer"
               },
               "penalty": {
                "type": "integer"
               },
               "diversions": {
                "type": "boolean"
               },
               "type": {
                "type": "string"
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "examples": {
         "400_queue_validation": {
          "summary": "400 - Queue Validation",
          "value": {
           "status": "validation",
           "message": "The provided description is already in use.",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/queues/inbound": {
   "get": {
    "tags": [
     "Queues"
    ],
    "summary": "List inbound queues",
    "description": "It returns the list of queues flagged as inbound.",
    "operationId": "get_queues_inbound",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_inbound_queues": {
          "summary": "200 - Inbound Queues",
          "value": {
           "status": "success",
           "message": null,
           "data": [
            {
             "queue_id": "2",
             "extension": "500",
             "queue_vip_list_id": null,
             "ivr_id": null,
             "queue_callback_id": "1",
             "cron_profile_id": null,
             "description": "Common Customers",
             "prefix": null,
             "direction": "inbound",
             "dial_mode": null,
             "destination_id": "298",
             "hangup_destination_id": null,
             "strategy": "rrordered",
             "music_group_id": "1",
             "weight": "10",
             "autofill": "yes",
             "maxlen": "0",
             "announcement_id": null,
             "periodic_announcement_id": "1",
             "join_announcement_id": null,
             "record": "no",
             "servicelevel": "40",
             "wrapuptime": "0",
             "announce_frequency": null,
             "min_announce_frequency": null,
             "periodic_announce_frequency": "10",
             "announce_round_seconds": "0",
             "announce_to_first_user": "no",
             "announce_position": "no",
             "announce_position_limit": null,
             "relative_periodic_announce": "no",
             "announce_holdtime": "no",
             "penaltymemberslimit": null,
             "autopause": "no",
             "ringinuse": "no",
             "memberdelay": null,
             "timeoutrestart": "no",
             "joinempty": "yes",
             "timeoutpriority": "app",
             "timeout": "15",
             "queue_timeout": "0",
             "leavewhenempty": "no",
             "retry": "5",
             "tenant_id": "1",
             "name": "Q500",
             "answered_elsewhere": "no",
             "agents_context": "queue-call-to-agents",
             "alertinfo": null,
             "answerchannel": "yes",
             "members": [
              {
               "member_id": 29,
               "extension": "101",
               "interface": "Local/101@queue-call-to-agents/n",
               "extension_id": 288,
               "penalty": 0,
               "diversions": true,
               "type": "dynamic",
               "name": "MicroSIP"
              },
              {
               "member_id": 39,
               "extension": "104",
               "interface": "Local/104@queue-call-to-agents/n",
               "extension_id": 6374,
               "penalty": 0,
               "diversions": true,
               "type": "dynamic",
               "name": "Bulk Test 104"
              }
             ]
            },
            {
             "queue_id": "3",
             "extension": "501",
             "queue_vip_list_id": null,
             "ivr_id": null,
             "queue_callback_id": null,
             "cron_profile_id": null,
             "description": "Premium Customers",
             "prefix": null,
             "direction": "inbound",
             "dial_mode": null,
             "destination_id": "299",
             "hangup_destination_id": null,
             "strategy": "rrordered",
             "music_group_id": "1",
             "weight": "20",
             "autofill": "yes",
             "maxlen": "0",
             "announcement_id": null,
             "periodic_announcement_id": "1",
             "join_announcement_id": null,
             "record": "no",
             "servicelevel": null,
             "wrapuptime": "0",
             "announce_frequency": null,
             "min_announce_frequency": null,
             "periodic_announce_frequency": null,
             "announce_round_seconds": "0",
             "announce_to_first_user": "no",
             "announce_position": "no",
             "announce_position_limit": null,
             "relative_periodic_announce": "no",
             "announce_holdtime": "no",
             "penaltymemberslimit": null,
             "autopause": "no",
             "ringinuse": "no",
             "memberdelay": null,
             "timeoutrestart": "no",
             "joinempty": "yes",
             "timeoutpriority": "app",
             "timeout": "15",
             "queue_timeout": "15",
             "leavewhenempty": "no",
             "retry": "5",
             "tenant_id": "1",
             "name": "Q501",
             "answered_elsewhere": "no",
             "agents_context": "queue-call-to-agents",
             "alertinfo": null,
             "answerchannel": "yes",
             "members": [
              {
               "member_id": 8,
               "extension": "101",
               "interface": "Local/101@queue-call-to-agents/n",
               "extension_id": 288,
               "penalty": 0,
               "diversions": false,
               "type": "dynamic",
               "name": "MicroSIP"
              }
             ]
            },
            {
             "queue_id": "4",
             "extension": "502",
             "queue_vip_list_id": null,
             "ivr_id": null,
             "queue_callback_id": null,
             "cron_profile_id": null,
             "description": "Provider",
             "prefix": null,
             "direction": "inbound",
             "dial_mode": null,
             "destination_id": "312",
             "hangup_destination_id": "313",
             "strategy": "ringall",
             "music_group_id": "1",
             "weight": null,
             "autofill": "yes",
             "maxlen": "0",
             "announcement_id": null,
             "periodic_announcement_id": "1",
             "join_announcement_id": null,
             "record": "no",
             "servicelevel": null,
             "wrapuptime": "0",
             "announce_frequency": null,
             "min_announce_frequency": null,
             "periodic_announce_frequency": null,
             "announce_round_seconds": "0",
             "announce_to_first_user": "no",
             "announce_position": "no",
             "announce_position_limit": null,
             "relative_periodic_announce": "no",
             "announce_holdtime": "no",
             "penaltymemberslimit": null,
             "autopause": "no",
             "ringinuse": "no",
             "memberdelay": null,
             "timeoutrestart": "no",
             "joinempty": "yes",
             "timeoutpriority": "app",
             "timeout": "15",
             "queue_timeout": "30",
             "leavewhenempty": "no",
             "retry": "5",
             "tenant_id": "1",
             "name": "Q502",
             "answered_elsewhere": "no",
             "agents_context": "queue-call-to-agents",
             "alertinfo": null,
             "answerchannel": "yes",
             "members": [
              {
               "member_id": 19,
               "extension": "100",
               "interface": "Local/100@queue-call-to-agents/n",
               "extension_id": 287,
               "penalty": 0,
               "diversions": false,
               "type": "dynamic",
               "name": "Jose Rivera"
              },
              {
               "member_id": 22,
               "extension": "101",
               "interface": "Local/101@queue-call-to-agents/n",
               "extension_id": 288,
               "penalty": 0,
               "diversions": false,
               "type": "dynamic",
               "name": "MicroSIP"
              },
              {
               "member_id": 25,
               "extension": "2503",
               "interface": "Local/2503@queue-call-to-agents/n",
               "extension_id": 6382,
               "penalty": 0,
               "diversions": false,
               "type": "static",
               "name": "Mark"
              },
              {
               "member_id": 28,
               "extension": "2504",
               "interface": "Local/2504@queue-call-to-agents/n",
               "extension_id": 6383,
               "penalty": 0,
               "diversions": false,
               "type": "static",
               "name": "Steve"
              },
              {
               "member_id": 31,
               "extension": "2505",
               "interface": "Local/2505@queue-call-to-agents/n",
               "extension_id": 6384,
               "penalty": 0,
               "diversions": false,
               "type": "static",
               "name": "Bill"
              }
             ]
            },
            {
             "queue_id": "9",
             "extension": "510",
             "queue_vip_list_id": null,
             "ivr_id": null,
             "queue_callback_id": null,
             "cron_profile_id": null,
             "description": "Etisalna PBX Partners",
             "prefix": null,
             "direction": "inbound",
             "dial_mode": null,
             "destination_id": "424",
             "hangup_destination_id": null,
             "strategy": "rrordered",
             "music_group_id": "1",
             "weight": "0",
             "autofill": "yes",
             "maxlen": "0",
             "announcement_id": null,
             "periodic_announcement_id": "1",
             "join_announcement_id": null,
             "record": "no",
             "servicelevel": "30",
             "wrapuptime": "0",
             "announce_frequency": null,
             "min_announce_frequency": null,
             "periodic_announce_frequency": "15",
             "announce_round_seconds": "0",
             "announce_to_first_user": "no",
             "announce_position": "no",
             "announce_position_limit": null,
             "relative_periodic_announce": "no",
             "announce_holdtime": "no",
             "penaltymemberslimit": null,
             "autopause": "no",
             "ringinuse": "no",
             "memberdelay": null,
             "timeoutrestart": "no",
             "joinempty": "yes",
             "timeoutpriority": "app",
             "timeout": "15",
             "queue_timeout": "300",
             "leavewhenempty": "no",
             "retry": "5",
             "tenant_id": "1",
             "name": "Q510",
             "answered_elsewhere": "no",
             "agents_context": "queue-call-to-agents",
             "alertinfo": null,
             "answerchannel": "yes",
             "members": [
              {
               "member_id": 41,
               "extension": "101",
               "interface": "Local/101@queue-call-to-agents/n",
               "extension_id": 288,
               "penalty": 0,
               "diversions": true,
               "type": "dynamic",
               "name": "MicroSIP"
              },
              {
               "member_id": 42,
               "extension": "104",
               "interface": "Local/104@queue-call-to-agents/n",
               "extension_id": 6374,
               "penalty": 0,
               "diversions": true,
               "type": "dynamic",
               "name": "Bulk Test 104"
              }
             ]
            }
           ]
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "queue_id": {
              "type": "string"
             },
             "extension": {
              "type": "string"
             },
             "queue_vip_list_id": {},
             "ivr_id": {},
             "queue_callback_id": {
              "type": "string"
             },
             "cron_profile_id": {},
             "description": {
              "type": "string"
             },
             "prefix": {},
             "direction": {
              "type": "string"
             },
             "dial_mode": {},
             "destination_id": {
              "type": "string"
             },
             "hangup_destination_id": {},
             "strategy": {
              "type": "string"
             },
             "music_group_id": {
              "type": "string"
             },
             "weight": {
              "type": "string"
             },
             "autofill": {
              "type": "string"
             },
             "maxlen": {
              "type": "string"
             },
             "announcement_id": {},
             "periodic_announcement_id": {
              "type": "string"
             },
             "join_announcement_id": {},
             "record": {
              "type": "string"
             },
             "servicelevel": {
              "type": "string"
             },
             "wrapuptime": {
              "type": "string"
             },
             "announce_frequency": {},
             "min_announce_frequency": {},
             "periodic_announce_frequency": {
              "type": "string"
             },
             "announce_round_seconds": {
              "type": "string"
             },
             "announce_to_first_user": {
              "type": "string"
             },
             "announce_position": {
              "type": "string"
             },
             "announce_position_limit": {},
             "relative_periodic_announce": {
              "type": "string"
             },
             "announce_holdtime": {
              "type": "string"
             },
             "penaltymemberslimit": {},
             "autopause": {
              "type": "string"
             },
             "ringinuse": {
              "type": "string"
             },
             "memberdelay": {},
             "timeoutrestart": {
              "type": "string"
             },
             "joinempty": {
              "type": "string"
             },
             "timeoutpriority": {
              "type": "string"
             },
             "timeout": {
              "type": "string"
             },
             "queue_timeout": {
              "type": "string"
             },
             "leavewhenempty": {
              "type": "string"
             },
             "retry": {
              "type": "string"
             },
             "tenant_id": {
              "type": "string"
             },
             "name": {
              "type": "string"
             },
             "answered_elsewhere": {
              "type": "string"
             },
             "agents_context": {
              "type": "string"
             },
             "alertinfo": {},
             "answerchannel": {
              "type": "string"
             },
             "members": {
              "type": "array",
              "items": {
               "type": "object",
               "properties": {
                "member_id": {
                 "type": "integer"
                },
                "extension": {
                 "type": "string"
                },
                "interface": {
                 "type": "string"
                },
                "extension_id": {
                 "type": "integer"
                },
                "penalty": {
                 "type": "integer"
                },
                "diversions": {
                 "type": "boolean"
                },
                "type": {
                 "type": "string"
                },
                "name": {
                 "type": "string"
                }
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/queues/outbound": {
   "get": {
    "tags": [
     "Queues"
    ],
    "summary": "List outbound queues",
    "description": "It returns the list of queues flagged as outbound.",
    "operationId": "get_queues_outbound",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_outbound_queues": {
          "summary": "200 - Outbound Queues",
          "value": {
           "status": "success",
           "message": null,
           "data": [
            {
             "queue_id": "10",
             "extension": "520",
             "queue_vip_list_id": null,
             "ivr_id": null,
             "queue_callback_id": null,
             "cron_profile_id": null,
             "description": "Portafolio Recovery",
             "prefix": null,
             "direction": "outbound",
             "dial_mode": "progressive",
             "destination_id": "425",
             "hangup_destination_id": null,
             "strategy": "rrordered",
             "music_group_id": "1",
             "weight": "0",
             "autofill": "yes",
             "maxlen": "0",
             "announcement_id": null,
             "periodic_announcement_id": "1",
             "join_announcement_id": null,
             "record": "no",
             "servicelevel": "30",
             "wrapuptime": "0",
             "announce_frequency": null,
             "min_announce_frequency": null,
             "periodic_announce_frequency": "15",
             "announce_round_seconds": "0",
             "announce_to_first_user": "no",
             "announce_position": "no",
             "announce_position_limit": null,
             "relative_periodic_announce": "no",
             "announce_holdtime": "no",
             "penaltymemberslimit": null,
             "autopause": "no",
             "ringinuse": "no",
             "memberdelay": null,
             "timeoutrestart": "no",
             "joinempty": "yes",
             "timeoutpriority": "app",
             "timeout": "15",
             "queue_timeout": "0",
             "leavewhenempty": "no",
             "retry": "5",
             "tenant_id": "1",
             "name": "Q520",
             "answered_elsewhere": "no",
             "agents_context": "queue-call-to-agents",
             "alertinfo": null,
             "answerchannel": "yes",
             "members": [
              {
               "member_id": 43,
               "extension": "101",
               "interface": "Local/101@queue-call-to-agents/n",
               "extension_id": 288,
               "penalty": 0,
               "diversions": true,
               "type": "dynamic",
               "name": "MicroSIP"
              },
              {
               "member_id": 44,
               "extension": "104",
               "interface": "Local/104@queue-call-to-agents/n",
               "extension_id": 6374,
               "penalty": 0,
               "diversions": true,
               "type": "dynamic",
               "name": "Bulk Test 104"
              }
             ]
            }
           ]
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "queue_id": {
              "type": "string"
             },
             "extension": {
              "type": "string"
             },
             "queue_vip_list_id": {},
             "ivr_id": {},
             "queue_callback_id": {},
             "cron_profile_id": {},
             "description": {
              "type": "string"
             },
             "prefix": {},
             "direction": {
              "type": "string"
             },
             "dial_mode": {
              "type": "string"
             },
             "destination_id": {
              "type": "string"
             },
             "hangup_destination_id": {},
             "strategy": {
              "type": "string"
             },
             "music_group_id": {
              "type": "string"
             },
             "weight": {
              "type": "string"
             },
             "autofill": {
              "type": "string"
             },
             "maxlen": {
              "type": "string"
             },
             "announcement_id": {},
             "periodic_announcement_id": {
              "type": "string"
             },
             "join_announcement_id": {},
             "record": {
              "type": "string"
             },
             "servicelevel": {
              "type": "string"
             },
             "wrapuptime": {
              "type": "string"
             },
             "announce_frequency": {},
             "min_announce_frequency": {},
             "periodic_announce_frequency": {
              "type": "string"
             },
             "announce_round_seconds": {
              "type": "string"
             },
             "announce_to_first_user": {
              "type": "string"
             },
             "announce_position": {
              "type": "string"
             },
             "announce_position_limit": {},
             "relative_periodic_announce": {
              "type": "string"
             },
             "announce_holdtime": {
              "type": "string"
             },
             "penaltymemberslimit": {},
             "autopause": {
              "type": "string"
             },
             "ringinuse": {
              "type": "string"
             },
             "memberdelay": {},
             "timeoutrestart": {
              "type": "string"
             },
             "joinempty": {
              "type": "string"
             },
             "timeoutpriority": {
              "type": "string"
             },
             "timeout": {
              "type": "string"
             },
             "queue_timeout": {
              "type": "string"
             },
             "leavewhenempty": {
              "type": "string"
             },
             "retry": {
              "type": "string"
             },
             "tenant_id": {
              "type": "string"
             },
             "name": {
              "type": "string"
             },
             "answered_elsewhere": {
              "type": "string"
             },
             "agents_context": {
              "type": "string"
             },
             "alertinfo": {},
             "answerchannel": {
              "type": "string"
             },
             "members": {
              "type": "array",
              "items": {
               "type": "object",
               "properties": {
                "member_id": {
                 "type": "integer"
                },
                "extension": {
                 "type": "string"
                },
                "interface": {
                 "type": "string"
                },
                "extension_id": {
                 "type": "integer"
                },
                "penalty": {
                 "type": "integer"
                },
                "diversions": {
                 "type": "boolean"
                },
                "type": {
                 "type": "string"
                },
                "name": {
                 "type": "string"
                }
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/queues/{queue_id}": {
   "get": {
    "tags": [
     "Queues"
    ],
    "summary": "Get queue",
    "description": "Get specific queue info",
    "operationId": "get_queues_queue_id",
    "parameters": [
     {
      "name": "queue_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "queue id"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_queue_retrieved": {
          "summary": "200 - Queue retrieved",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "queue_id": 2,
            "extension": 501,
            "queue_vip_list_id": null,
            "ivr_id": 1,
            "queue_callback_id": null,
            "cron_profile_id": null,
            "description": "Sales",
            "prefix": null,
            "destination_id": 10,
            "hangup_destination_id": null,
            "strategy": "ringall",
            "music_group_id": null,
            "weight": null,
            "autofill": true,
            "maxlen": 0,
            "announcement_id": null,
            "periodic_announcement_id": 1,
            "join_announcement_id": null,
            "record": true,
            "servicelevel": 20,
            "wrapuptime": 0,
            "announce_frequency": null,
            "min_announce_frequency": null,
            "periodic_announce_frequency": null,
            "announce_round_seconds": "0",
            "announce_to_first_user": false,
            "announce_position": "no",
            "announce_position_limit": null,
            "relative_periodic_announce": false,
            "announce_holdtime": false,
            "penaltymemberslimit": null,
            "autopause": "no",
            "ringinuse": false,
            "memberdelay": null,
            "timeoutrestart": false,
            "joinempty": "yes",
            "timeoutpriority": "app",
            "timeout": 15,
            "queue_timeout": 10,
            "leavewhenempty": "no",
            "retry": 5,
            "tenant_id": 1,
            "name": "Q501",
            "answered_elsewhere": false,
            "agents_context": "queue-call-to-agents",
            "members": [
             {
              "extension": "2001",
              "interface": "Local/2001@queue-call-to-agents/n",
              "extension_id": 243,
              "penalty": 0,
              "diversions": false,
              "type": "dynamic"
             }
            ]
           }
          }
         },
         "queues_id": {
          "summary": "/queues/{id}",
          "value": {
           "status": "success",
           "data": {
            "queue_id": 2,
            "extension": 501,
            "queue_vip_list_id": null,
            "ivr_id": 1,
            "queue_callback_id": null,
            "cron_profile_id": null,
            "description": "Sales",
            "prefix": null,
            "destination_id": 10,
            "hangup_destination_id": null,
            "strategy": "ringall",
            "music_group_id": null,
            "weight": null,
            "autofill": true,
            "maxlen": 0,
            "announcement_id": null,
            "periodic_announcement_id": 1,
            "join_announcement_id": null,
            "record": true,
            "servicelevel": 20,
            "wrapuptime": 0,
            "announce_frequency": null,
            "min_announce_frequency": null,
            "periodic_announce_frequency": null,
            "announce_round_seconds": "0",
            "announce_to_first_user": false,
            "announce_position": "no",
            "announce_position_limit": null,
            "relative_periodic_announce": false,
            "announce_holdtime": false,
            "penaltymemberslimit": null,
            "autopause": "no",
            "ringinuse": false,
            "memberdelay": null,
            "timeoutrestart": false,
            "joinempty": "yes",
            "timeoutpriority": "app",
            "timeout": 15,
            "queue_timeout": 10,
            "leavewhenempty": "no",
            "retry": 5,
            "tenant_id": 1,
            "name": "Q501",
            "answered_elsewhere": false,
            "agents_context": "queue-call-to-agents",
            "members": [
             {
              "queue_member_id": "89",
              "queue_id": "2",
              "extension_id": "243",
              "penalty": "0",
              "diversions": "no",
              "type": "dynamic",
              "extension": "2001",
              "name": "Person 01"
             }
            ]
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "object",
           "properties": {
            "queue_id": {
             "type": "integer"
            },
            "extension": {
             "type": "integer"
            },
            "queue_vip_list_id": {},
            "ivr_id": {
             "type": "integer"
            },
            "queue_callback_id": {},
            "cron_profile_id": {},
            "description": {
             "type": "string"
            },
            "prefix": {},
            "destination_id": {
             "type": "integer"
            },
            "hangup_destination_id": {},
            "strategy": {
             "type": "string"
            },
            "music_group_id": {},
            "weight": {},
            "autofill": {
             "type": "boolean"
            },
            "maxlen": {
             "type": "integer"
            },
            "announcement_id": {},
            "periodic_announcement_id": {
             "type": "integer"
            },
            "join_announcement_id": {},
            "record": {
             "type": "boolean"
            },
            "servicelevel": {
             "type": "integer"
            },
            "wrapuptime": {
             "type": "integer"
            },
            "announce_frequency": {},
            "min_announce_frequency": {},
            "periodic_announce_frequency": {},
            "announce_round_seconds": {
             "type": "string"
            },
            "announce_to_first_user": {
             "type": "boolean"
            },
            "announce_position": {
             "type": "string"
            },
            "announce_position_limit": {},
            "relative_periodic_announce": {
             "type": "boolean"
            },
            "announce_holdtime": {
             "type": "boolean"
            },
            "penaltymemberslimit": {},
            "autopause": {
             "type": "string"
            },
            "ringinuse": {
             "type": "boolean"
            },
            "memberdelay": {},
            "timeoutrestart": {
             "type": "boolean"
            },
            "joinempty": {
             "type": "string"
            },
            "timeoutpriority": {
             "type": "string"
            },
            "timeout": {
             "type": "integer"
            },
            "queue_timeout": {
             "type": "integer"
            },
            "leavewhenempty": {
             "type": "string"
            },
            "retry": {
             "type": "integer"
            },
            "tenant_id": {
             "type": "integer"
            },
            "name": {
             "type": "string"
            },
            "answered_elsewhere": {
             "type": "boolean"
            },
            "agents_context": {
             "type": "string"
            },
            "members": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "extension": {
                "type": "string"
               },
               "interface": {
                "type": "string"
               },
               "extension_id": {
                "type": "integer"
               },
               "penalty": {
                "type": "integer"
               },
               "diversions": {
                "type": "boolean"
               },
               "type": {
                "type": "string"
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "examples": {
         "queue_not_found": {
          "summary": "Queue not found",
          "value": {
           "status": "not_found",
           "message": "The requested queue doesn't exists",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    }
   },
   "put": {
    "tags": [
     "Queues"
    ],
    "summary": "Update queue",
    "description": "This endpoint allows you to update an existing queue. For more info about parameters and their possible values, check the table above.",
    "operationId": "put_queues_queue_id",
    "parameters": [
     {
      "name": "queue_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "queue id"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "queue_vip_list_id": {},
         "ivr_id": {},
         "queue_callback_id": {},
         "cron_profile_id": {},
         "description": {
          "type": "string"
         },
         "prefix": {},
         "direction": {
          "type": "string"
         },
         "dial_mode": {},
         "strategy": {
          "type": "string"
         },
         "music_group_id": {
          "type": "integer"
         },
         "weight": {
          "type": "integer"
         },
         "autofill": {
          "type": "boolean"
         },
         "maxlen": {
          "type": "integer"
         },
         "announcement_id": {},
         "periodic_announcement_id": {
          "type": "integer"
         },
         "join_announcement_id": {},
         "record": {
          "type": "boolean"
         },
         "servicelevel": {
          "type": "integer"
         },
         "wrapuptime": {
          "type": "integer"
         },
         "announce_frequency": {},
         "min_announce_frequency": {},
         "periodic_announce_frequency": {
          "type": "integer"
         },
         "announce_round_seconds": {
          "type": "integer"
         },
         "announce_to_first_user": {
          "type": "boolean"
         },
         "announce_position": {
          "type": "string"
         },
         "announce_position_limit": {},
         "relative_periodic_announce": {
          "type": "boolean"
         },
         "announce_holdtime": {
          "type": "boolean"
         },
         "penaltymemberslimit": {},
         "autopause": {
          "type": "string"
         },
         "ringinuse": {
          "type": "boolean"
         },
         "ring_unavailable": {
          "type": "boolean"
         },
         "memberdelay": {},
         "timeoutrestart": {
          "type": "boolean"
         },
         "joinempty": {
          "type": "string"
         },
         "timeoutpriority": {
          "type": "string"
         },
         "timeout": {
          "type": "integer"
         },
         "queue_timeout": {
          "type": "integer"
         },
         "leavewhenempty": {
          "type": "string"
         },
         "retry": {
          "type": "integer"
         },
         "answered_elsewhere": {
          "type": "boolean"
         },
         "alertinfo": {},
         "answerchannel": {
          "type": "boolean"
         },
         "members": {
          "type": "array",
          "items": {
           "type": "object",
           "properties": {
            "member_id": {
             "type": "integer"
            },
            "extension_id": {
             "type": "integer"
            },
            "penalty": {
             "type": "integer"
            },
            "diversions": {
             "type": "boolean"
            },
            "type": {
             "type": "string"
            }
           }
          }
         },
         "final_destination": {
          "type": "object",
          "properties": {
           "cetegory_id": {
            "type": "integer"
           },
           "destination_id": {
            "type": "integer"
           }
          }
         },
         "after_hangup_destination": {
          "type": "object",
          "properties": {
           "cetegory_id": {},
           "destination_id": {}
          }
         }
        }
       },
       "example": {
        "queue_vip_list_id": null,
        "ivr_id": null,
        "queue_callback_id": null,
        "cron_profile_id": null,
        "description": "Etisalna PBX Partners",
        "prefix": null,
        "direction": "inbound",
        "dial_mode": null,
        "strategy": "rrordered",
        "music_group_id": 1,
        "weight": 0,
        "autofill": true,
        "maxlen": 0,
        "announcement_id": null,
        "periodic_announcement_id": 1,
        "join_announcement_id": null,
        "record": false,
        "servicelevel": 30,
        "wrapuptime": 0,
        "announce_frequency": null,
        "min_announce_frequency": null,
        "periodic_announce_frequency": 15,
        "announce_round_seconds": 0,
        "announce_to_first_user": false,
        "announce_position": "no",
        "announce_position_limit": null,
        "relative_periodic_announce": false,
        "announce_holdtime": false,
        "penaltymemberslimit": null,
        "autopause": "no",
        "ringinuse": false,
        "ring_unavailable": false,
        "memberdelay": null,
        "timeoutrestart": false,
        "joinempty": "yes",
        "timeoutpriority": "app",
        "timeout": 15,
        "queue_timeout": 300,
        "leavewhenempty": "no",
        "retry": 5,
        "answered_elsewhere": false,
        "alertinfo": null,
        "answerchannel": true,
        "members": [
         {
          "member_id": 41,
          "extension_id": 288,
          "penalty": 0,
          "diversions": true,
          "type": "dynamic"
         },
         {
          "member_id": 42,
          "extension_id": 6374,
          "penalty": 0,
          "diversions": true,
          "type": "dynamic"
         }
        ],
        "final_destination": {
         "cetegory_id": 24,
         "destination_id": 1
        },
        "after_hangup_destination": {
         "cetegory_id": null,
         "destination_id": null
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_queue_updated": {
          "summary": "200 - Queue Updated",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "queue_id": 9,
            "extension": 510,
            "queue_vip_list_id": null,
            "ivr_id": null,
            "queue_callback_id": null,
            "cron_profile_id": null,
            "description": "Etisalna PBX Partners",
            "prefix": null,
            "direction": "inbound",
            "dial_mode": null,
            "destination_id": 424,
            "hangup_destination_id": null,
            "strategy": "rrordered",
            "music_group_id": 1,
            "weight": 0,
            "autofill": true,
            "maxlen": 0,
            "announcement_id": null,
            "periodic_announcement_id": 1,
            "join_announcement_id": null,
            "record": false,
            "servicelevel": 30,
            "wrapuptime": 0,
            "announce_frequency": null,
            "min_announce_frequency": null,
            "periodic_announce_frequency": "15",
            "announce_round_seconds": "0",
            "announce_to_first_user": false,
            "announce_position": "no",
            "announce_position_limit": null,
            "relative_periodic_announce": false,
            "announce_holdtime": false,
            "penaltymemberslimit": null,
            "autopause": "no",
            "ringinuse": false,
            "memberdelay": null,
            "timeoutrestart": false,
            "joinempty": "yes",
            "timeoutpriority": "app",
            "timeout": 15,
            "queue_timeout": 300,
            "leavewhenempty": "no",
            "retry": 5,
            "tenant_id": 1,
            "name": "Q510",
            "answered_elsewhere": false,
            "agents_context": "queue-call-to-agents",
            "alertinfo": null,
            "answerchannel": true,
            "members": [
             {
              "member_id": 41,
              "extension_id": 288,
              "penalty": 0,
              "diversions": true,
              "type": "dynamic"
             },
             {
              "member_id": 42,
              "extension_id": 6374,
              "penalty": 0,
              "diversions": true,
              "type": "dynamic"
             }
            ]
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "object",
           "properties": {
            "queue_id": {
             "type": "integer"
            },
            "extension": {
             "type": "integer"
            },
            "queue_vip_list_id": {},
            "ivr_id": {},
            "queue_callback_id": {},
            "cron_profile_id": {},
            "description": {
             "type": "string"
            },
            "prefix": {},
            "direction": {
             "type": "string"
            },
            "dial_mode": {},
            "destination_id": {
             "type": "integer"
            },
            "hangup_destination_id": {},
            "strategy": {
             "type": "string"
            },
            "music_group_id": {
             "type": "integer"
            },
            "weight": {
             "type": "integer"
            },
            "autofill": {
             "type": "boolean"
            },
            "maxlen": {
             "type": "integer"
            },
            "announcement_id": {},
            "periodic_announcement_id": {
             "type": "integer"
            },
            "join_announcement_id": {},
            "record": {
             "type": "boolean"
            },
            "servicelevel": {
             "type": "integer"
            },
            "wrapuptime": {
             "type": "integer"
            },
            "announce_frequency": {},
            "min_announce_frequency": {},
            "periodic_announce_frequency": {
             "type": "string"
            },
            "announce_round_seconds": {
             "type": "string"
            },
            "announce_to_first_user": {
             "type": "boolean"
            },
            "announce_position": {
             "type": "string"
            },
            "announce_position_limit": {},
            "relative_periodic_announce": {
             "type": "boolean"
            },
            "announce_holdtime": {
             "type": "boolean"
            },
            "penaltymemberslimit": {},
            "autopause": {
             "type": "string"
            },
            "ringinuse": {
             "type": "boolean"
            },
            "memberdelay": {},
            "timeoutrestart": {
             "type": "boolean"
            },
            "joinempty": {
             "type": "string"
            },
            "timeoutpriority": {
             "type": "string"
            },
            "timeout": {
             "type": "integer"
            },
            "queue_timeout": {
             "type": "integer"
            },
            "leavewhenempty": {
             "type": "string"
            },
            "retry": {
             "type": "integer"
            },
            "tenant_id": {
             "type": "integer"
            },
            "name": {
             "type": "string"
            },
            "answered_elsewhere": {
             "type": "boolean"
            },
            "agents_context": {
             "type": "string"
            },
            "alertinfo": {},
            "answerchannel": {
             "type": "boolean"
            },
            "members": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "member_id": {
                "type": "integer"
               },
               "extension_id": {
                "type": "integer"
               },
               "penalty": {
                "type": "integer"
               },
               "diversions": {
                "type": "boolean"
               },
               "type": {
                "type": "string"
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   },
   "delete": {
    "tags": [
     "Queues"
    ],
    "summary": "Delete queue",
    "description": "It allows to remove an existing queue.",
    "operationId": "delete_queues_queue_id",
    "parameters": [
     {
      "name": "queue_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "queue id"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_queue_removed": {
          "summary": "200 - Queue Removed",
          "value": {
           "status": "success",
           "message": "The queue have been removed",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/route_selections": {
   "get": {
    "tags": [
     "Route Selections"
    ],
    "summary": "List route selections",
    "description": "This endpoint returns all the route selection items filtered by tenant.",
    "operationId": "get_route_selections",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_get_all_route_selection_items": {
          "summary": "200 - Get All Route Selection Items",
          "value": {
           "status": "success",
           "message": null,
           "data": [
            {
             "ars_id": 1,
             "description": "none",
             "default": true,
             "tenant_id": 1
            },
            {
             "ars_id": 4,
             "description": "Test Time",
             "default": false,
             "tenant_id": 1
            },
            {
             "ars_id": 5,
             "description": "International Calls",
             "default": false,
             "tenant_id": 1
            }
           ]
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "ars_id": {
              "type": "integer"
             },
             "description": {
              "type": "string"
             },
             "default": {
              "type": "boolean"
             },
             "tenant_id": {
              "type": "integer"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/route_selections/{id}": {
   "get": {
    "tags": [
     "Route Selections"
    ],
    "summary": "Get route selection",
    "description": "This endpoint returns a specific route selection item filtered by ID.",
    "operationId": "get_route_selections_id",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "Record ID"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_single_route_selection_item": {
          "summary": "200 - Single Route Selection Item",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "ars_id": 1,
            "description": "none",
            "default": true,
            "tenant_id": 1
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "object",
           "properties": {
            "ars_id": {
             "type": "integer"
            },
            "description": {
             "type": "string"
            },
            "default": {
             "type": "boolean"
            },
            "tenant_id": {
             "type": "integer"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "examples": {
         "404_not_found_item": {
          "summary": "404 - Not Found Item",
          "value": {
           "status": "not_found",
           "message": "The requested route selection item doesn't exists",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/roles": {
   "get": {
    "tags": [
     "Roles"
    ],
    "summary": "List roles",
    "description": "It retrieves information of a single role.",
    "operationId": "get_roles_",
    "parameters": [
     {
      "name": "name",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_single_role": {
          "summary": "200 - Single Role",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "role_id": 4,
            "role": "tenant_admin",
            "description": "Tenant Administrator",
            "default": true,
            "tenant_id": 1,
            "permissions": {
             "change_language": "yes",
             "get_updates": "no",
             "update_profile": "yes"
            }
           }
          }
         },
         "200_role_retrieved_by_name": {
          "summary": "200 - Role retrieved by name",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "role_id": "4",
            "role": "tenant_admin",
            "description": "Tenant Administrator",
            "default": "yes",
            "tenant_id": "1",
            "permissions": {
             "change_language": "yes",
             "get_updates": "no",
             "update_profile": "yes"
            }
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "object",
           "properties": {
            "role_id": {
             "type": "integer"
            },
            "role": {
             "type": "string"
            },
            "description": {
             "type": "string"
            },
            "default": {
             "type": "boolean"
            },
            "tenant_id": {
             "type": "integer"
            },
            "permissions": {
             "type": "object",
             "properties": {
              "change_language": {
               "type": "string"
              },
              "get_updates": {
               "type": "string"
              },
              "update_profile": {
               "type": "string"
              }
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "examples": {
         "404_role_not_found": {
          "summary": "404 - Role Not Found",
          "value": {
           "status": "not_found",
           "message": "The requested role doesn't exist",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/roles/{id}": {
   "get": {
    "tags": [
     "Roles"
    ],
    "summary": "Get role",
    "description": "It retrieves information of a single role.",
    "operationId": "get_roles_id",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "Record ID"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_single_role": {
          "summary": "200 - Single Role",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "role_id": 4,
            "role": "tenant_admin",
            "description": "Tenant Administrator",
            "default": true,
            "tenant_id": 1,
            "permissions": {
             "change_language": "yes",
             "get_updates": "no",
             "update_profile": "yes"
            }
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "object",
           "properties": {
            "role_id": {
             "type": "integer"
            },
            "role": {
             "type": "string"
            },
            "description": {
             "type": "string"
            },
            "default": {
             "type": "boolean"
            },
            "tenant_id": {
             "type": "integer"
            },
            "permissions": {
             "type": "object",
             "properties": {
              "change_language": {
               "type": "string"
              },
              "get_updates": {
               "type": "string"
              },
              "update_profile": {
               "type": "string"
              }
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "examples": {
         "404_role_not_found": {
          "summary": "404 - Role Not Found",
          "value": {
           "status": "not_found",
           "message": "The requested role doesn't exist",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/roles/{id}/modules": {
   "get": {
    "tags": [
     "Roles"
    ],
    "summary": "List modules of a role",
    "description": "It retrieves the list of modules allowed for a specific role.",
    "operationId": "get_roles_id_modules",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "Record ID"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_role_modules": {
          "summary": "200 - Role Modules",
          "value": {
           "status": "success",
           "message": null,
           "data": [
            {
             "id": 1,
             "name": "extensions",
             "display_name": "Extensions",
             "multi_tenant_capable": true
            },
            {
             "id": 2,
             "name": "hot_desking",
             "display_name": "Hot Desking",
             "multi_tenant_capable": true
            },
            {
             "id": 4,
             "name": "import_extensions",
             "display_name": "Import Extensions",
             "multi_tenant_capable": true
            },
            {
             "id": 103,
             "name": "export_extensions",
             "display_name": "Export Extensions",
             "multi_tenant_capable": true
            },
            {
             "id": 5,
             "name": "bulk_modification",
             "display_name": "Bulk Modification",
             "multi_tenant_capable": true
            },
            {
             "id": 152,
             "name": "bulk_extensions",
             "display_name": "Bulk Extensions",
             "multi_tenant_capable": false
            },
            {
             "id": 6,
             "name": "extensions_status",
             "display_name": "Extensions Status",
             "multi_tenant_capable": true
            },
            {
             "id": 8,
             "name": "conferences",
             "display_name": "Conferences",
             "multi_tenant_capable": true
            },
            {
             "id": 9,
             "name": "custom_app",
             "display_name": "Custom Applications",
             "multi_tenant_capable": true
            },
            {
             "id": 10,
             "name": "custom_dest",
             "display_name": "Custom Destinations",
             "multi_tenant_capable": true
            },
            {
             "id": 12,
             "name": "paging",
             "display_name": "Paging & Intercom",
             "multi_tenant_capable": true
            },
            {
             "id": 93,
             "name": "pickup_group",
             "display_name": "Pickup Groups",
             "multi_tenant_capable": true
            },
            {
             "id": 11,
             "name": "parking",
             "display_name": "Parking",
             "multi_tenant_capable": true
            },
            {
             "id": 7,
             "name": "speeddial",
             "display_name": "Speed Dialing",
             "multi_tenant_capable": true
            },
            {
             "id": 109,
             "name": "import_speeddial",
             "display_name": "Import/Export Speed Dialing",
             "multi_tenant_capable": true
            },
            {
             "id": 14,
             "name": "vmgroup",
             "display_name": "Voicemail Broadcast Groups",
             "multi_tenant_capable": true
            },
            {
             "id": 38,
             "name": "call_back",
             "display_name": "Call Back",
             "multi_tenant_capable": true
            },
            {
             "id": 30,
             "name": "disa",
             "display_name": "DISA",
             "multi_tenant_capable": true
            },
            {
             "id": 24,
             "name": "pin",
             "display_name": "PIN Lists",
             "multi_tenant_capable": true
            },
            {
             "id": 15,
             "name": "class_of_service",
             "display_name": "Class of Service",
             "multi_tenant_capable": true
            },
            {
             "id": 16,
             "name": "feature_category",
             "display_name": "Feature Categories",
             "multi_tenant_capable": true
            },
            {
             "id": 17,
             "name": "dialrules",
             "display_name": "Dialing Restriction Rules",
             "multi_tenant_capable": true
            },
            {
             "id": 18,
             "name": "accountcode",
             "display_name": "Customer Codes",
             "multi_tenant_capable": true
            },
            {
             "id": 19,
             "name": "authcode",
             "display_name": "Authorization Codes",
             "multi_tenant_capable": true
            },
            {
             "id": 28,
             "name": "ars",
             "display_name": "Route Selections",
             "multi_tenant_capable": true
            },
            {
             "id": 20,
             "name": "ring_group",
             "display_name": "Ring Groups",
             "multi_tenant_capable": true
            },
            {
             "id": 21,
             "name": "queues",
             "display_name": "Queues",
             "multi_tenant_capable": true
            },
            {
             "id": 22,
             "name": "queues_priority",
             "display_name": "Queue Priorities",
             "multi_tenant_capable": true
            },
            {
             "id": 23,
             "name": "queues_vip",
             "display_name": "Queue VIPs",
             "multi_tenant_capable": true
            },
            {
             "id": 26,
             "name": "trunks",
             "display_name": "Trunks",
             "multi_tenant_capable": true
            },
            {
             "id": 27,
             "name": "trunk_group",
             "display_name": "Outbound Routes",
             "multi_tenant_capable": true
            },
            {
             "id": 29,
             "name": "inbound_route",
             "display_name": "Inbound Routes",
             "multi_tenant_capable": true
            },
            {
             "id": 128,
             "name": "dynamic_routing",
             "display_name": "Dynamic Routing",
             "multi_tenant_capable": true
            },
            {
             "id": 31,
             "name": "ivr",
             "display_name": "IVR",
             "multi_tenant_capable": true
            },
            {
             "id": 32,
             "name": "time_group",
             "display_name": "Time Groups",
             "multi_tenant_capable": true
            },
            {
             "id": 79,
             "name": "time_conditions",
             "display_name": "Time Conditions",
             "multi_tenant_capable": true
            },
            {
             "id": 33,
             "name": "preannoun",
             "display_name": "Announcements",
             "multi_tenant_capable": true
            },
            {
             "id": 34,
             "name": "languages",
             "display_name": "Languages",
             "multi_tenant_capable": true
            },
            {
             "id": 35,
             "name": "nightmode",
             "display_name": "Night Mode",
             "multi_tenant_capable": true
            },
            {
             "id": 104,
             "name": "cid_management",
             "display_name": "CID Modifiers",
             "multi_tenant_capable": true
            },
            {
             "id": 116,
             "name": "cid_lookup",
             "display_name": "CID Lookup",
             "multi_tenant_capable": true
            },
            {
             "id": 36,
             "name": "blacklist",
             "display_name": "Blacklist",
             "multi_tenant_capable": true
            },
            {
             "id": 87,
             "name": "dashboard",
             "display_name": "Dashboard",
             "multi_tenant_capable": true
            },
            {
             "id": 117,
             "name": "cron_profiles",
             "display_name": "Cron Profiles",
             "multi_tenant_capable": true
            },
            {
             "id": 85,
             "name": "weak_password",
             "display_name": "Weak Passwords",
             "multi_tenant_capable": true
            },
            {
             "id": 146,
             "name": "phone_books",
             "display_name": "Phonebooks",
             "multi_tenant_capable": true
            },
            {
             "id": 119,
             "name": "emergency_numbers",
             "display_name": "Emergency Numbers",
             "multi_tenant_capable": true
            },
            {
             "id": 138,
             "name": "emergency_locations",
             "display_name": "Dispatchable Locations",
             "multi_tenant_capable": true
            },
            {
             "id": 161,
             "name": "provisioning_templates",
             "display_name": "Templates",
             "multi_tenant_capable": false
            },
            {
             "id": 162,
             "name": "provisioning",
             "display_name": "Provisioning",
             "multi_tenant_capable": false
            },
            {
             "id": 140,
             "name": "fax_devices",
             "display_name": "Fax Devices",
             "multi_tenant_capable": true
            },
            {
             "id": 142,
             "name": "fax_sending",
             "display_name": "Fax Sending",
             "multi_tenant_capable": true
            },
            {
             "id": 143,
             "name": "fax_viewer",
             "display_name": "Fax Viewer",
             "multi_tenant_capable": true
            },
            {
             "id": 88,
             "name": "cdr_filters",
             "display_name": "CDR Filters",
             "multi_tenant_capable": true
            },
            {
             "id": 41,
             "name": "repcdr",
             "display_name": "CDR",
             "multi_tenant_capable": true
            },
            {
             "id": 137,
             "name": "active_calls",
             "display_name": "Active Calls",
             "multi_tenant_capable": false
            },
            {
             "id": 134,
             "name": "pjsip_endpoints",
             "display_name": "PJSIP Endpoints",
             "multi_tenant_capable": true
            },
            {
             "id": 135,
             "name": "sip_report",
             "display_name": "SIP Devices",
             "multi_tenant_capable": true
            },
            {
             "id": 136,
             "name": "iax2_report",
             "display_name": "IAX2 Devices",
             "multi_tenant_capable": true
            },
            {
             "id": 105,
             "name": "dial_profiles",
             "display_name": "Dial Profiles",
             "multi_tenant_capable": true
            },
            {
             "id": 47,
             "name": "astmanager_users",
             "display_name": "Asterisk Manager Users",
             "multi_tenant_capable": true
            },
            {
             "id": 48,
             "name": "music_on_hold",
             "display_name": "Music on Hold",
             "multi_tenant_capable": true
            },
            {
             "id": 49,
             "name": "recmanagement",
             "display_name": "Recordings Management",
             "multi_tenant_capable": true
            },
            {
             "id": 57,
             "name": "users",
             "display_name": "Users",
             "multi_tenant_capable": true
            },
            {
             "id": 58,
             "name": "users_profiles",
             "display_name": "User Profiles",
             "multi_tenant_capable": true
            },
            {
             "id": 127,
             "name": "app_keys",
             "display_name": "Application Keys",
             "multi_tenant_capable": false
            }
           ]
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "integer"
             },
             "name": {
              "type": "string"
             },
             "display_name": {
              "type": "string"
             },
             "multi_tenant_capable": {
              "type": "boolean"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/sms/phone_numbers": {
   "get": {
    "tags": [
     "SMS"
    ],
    "summary": "List SMS phone numbers",
    "description": "It returns the list of the available phone numbers with SMS capabilities configured in the Messaging Providers module.",
    "operationId": "get_sms_phone_numbers",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_phone_numbers_retrieved": {
          "summary": "200 - Phone Numbers Retrieved",
          "value": {
           "status": "success",
           "message": null,
           "data": [
            {
             "id": 1,
             "phone_number": "+13055605776",
             "description": "Main",
             "provider": "telnyx",
             "accepted_format": "e164"
            }
           ]
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "integer"
             },
             "phone_number": {
              "type": "string"
             },
             "description": {
              "type": "string"
             },
             "provider": {
              "type": "string"
             },
             "accepted_format": {
              "type": "string"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/sms/phone_numbers/{sms_pn_id}/send_sms": {
   "post": {
    "tags": [
     "SMS"
    ],
    "summary": "Send an SMS",
    "description": "It allows you to send an SMS using a phone number configured in the Messaging Provider module. Depending on the provider, the recipient must comply with a certain format.\n\nThe formats that are available are:\n\n| **Format** | **Example** | **Providers** |\n| --- | --- | --- |\n| +E.164 | +13519283109 | Telnyx, Twilio |\n| 11-digit | 12093102242 | Skyetel |\n| 10-digit | 5056446121 | Queuest Blue |\n\n The parameters for this endpoint are:\n\n| **Parameter** | **Description** |\n| --- | --- |\n| to | The number that will receive the message. |\n| message | The message to send. |\n\n We strongly recommend that you check the character and rate limits of each provider.",
    "operationId": "post_sms_phone_numbers_sms_pn_id_send_sms",
    "parameters": [
     {
      "name": "sms_pn_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "sms pn id"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "to": {
          "type": "string"
         },
         "message": {
          "type": "string"
         }
        }
       },
       "example": {
        "to": "966500000000",
        "message": "Ahoy Mate! Welcome to Etisalna PBX!"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_message_sent": {
          "summary": "200 - Message Sent",
          "value": {
           "status": "success",
           "message": "The message is queued for sending",
           "data": {
            "msg_id": "40318d6a-b63a-491f-8714-fcf56f029528",
            "status": "queued"
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "object",
           "properties": {
            "msg_id": {
             "type": "string"
            },
            "status": {
             "type": "string"
            }
           }
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Bad Request",
      "content": {
       "application/json": {
        "examples": {
         "400_invalid_number_format": {
          "summary": "400 - Invalid Number Format",
          "value": {
           "status": "validation",
           "message": "The format of the given number is not valid. You must provide a number in the format +E.164(e.g., +13235550150).",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/sms/messages/{msg_id}": {
   "get": {
    "tags": [
     "SMS"
    ],
    "summary": "Get an SMS message status",
    "description": "",
    "operationId": "get_sms_messages_msg_id",
    "parameters": [
     {
      "name": "msg_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "msg id"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_message_retrieved": {
          "summary": "200 - Message Retrieved",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "id": 1,
            "connection_id": 1,
            "sender": "+13055605776",
            "recipient": "+12195518053",
            "message": "Ahoy Mate! Welcome to Etisalna PBX!",
            "direction": "out",
            "status": "queued",
            "created_at": 1674878753,
            "uid": "403185f6-8d9a-445d-a81e-1f5ef4d20c3f",
            "errors": null,
            "tenant_id": 1
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "object",
           "properties": {
            "id": {
             "type": "integer"
            },
            "connection_id": {
             "type": "integer"
            },
            "sender": {
             "type": "string"
            },
            "recipient": {
             "type": "string"
            },
            "message": {
             "type": "string"
            },
            "direction": {
             "type": "string"
            },
            "status": {
             "type": "string"
            },
            "created_at": {
             "type": "integer"
            },
            "uid": {
             "type": "string"
            },
            "errors": {},
            "tenant_id": {
             "type": "integer"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "examples": {
         "404_message_not_found": {
          "summary": "404 - Message not found",
          "value": {
           "status": "not_found",
           "message": "Cannot found the requested message",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/trunks/{id}": {
   "get": {
    "tags": [
     "Trunks"
    ],
    "summary": "Get trunk",
    "description": "",
    "operationId": "get_trunks_id",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "Record ID"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_retrieve_single_trunk": {
          "summary": "200 - Retrieve single trunk",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "trunk_id": 1,
            "description": "Etisalna PBX",
            "technology": "SIP",
            "class_of_service_id": null,
            "dial_profile_id": 1,
            "tenant_trunk_id": null,
            "profile_id": 1,
            "ringtimer": 90,
            "music_group_id": 6,
            "register": null,
            "dialstring": null,
            "trunk_cid": "\"Etisalna PBX LLC\" <35925555${CS:0:3}>",
            "overwrite_cid": false,
            "group_id": null,
            "group_mode": "g",
            "outgoing_username": "eBD-Ombutel",
            "incoming_username": null,
            "dial_string": null,
            "codecs": null,
            "nat": "no",
            "dtmfmode": "auto",
            "simultaneous_calls": 10,
            "get_did_from": null,
            "get_cid_from": "contact",
            "mode": "visual",
            "register_flag": false,
            "disable": false,
            "continue_on_busy": true,
            "tenant_id": 1,
            "username": "eBD-Ombutel",
            "channels": []
           }
          }
         },
         "trunk_id": {
          "summary": "/trunk/{id}",
          "value": {
           "status": "success",
           "data": {
            "trunk_id": 1,
            "description": "Etisalna PBX",
            "technology": "sip",
            "class_of_service_id": null,
            "dial_profile_id": 1,
            "tenant_trunk_id": null,
            "ringtimer": 90,
            "music_group_id": 6,
            "register": null,
            "dialstring": null,
            "trunk_cid": "\"Etisalna PBX LLC\" <35925555${CS:0:3}>",
            "overwrite_cid": false,
            "group_id": null,
            "group_mode": "g",
            "outgoing_username": "eBD-Ombutel",
            "incoming_username": null,
            "dial_string": null,
            "codecs": null,
            "nat": "no",
            "simultaneous_calls": 10,
            "get_did_from": null,
            "get_cid_from": "contact",
            "mode": "visual",
            "register_flag": false,
            "disable": false,
            "continue_on_busy": true,
            "tenant_id": 1
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "object",
           "properties": {
            "trunk_id": {
             "type": "integer"
            },
            "description": {
             "type": "string"
            },
            "technology": {
             "type": "string"
            },
            "class_of_service_id": {},
            "dial_profile_id": {
             "type": "integer"
            },
            "tenant_trunk_id": {},
            "profile_id": {
             "type": "integer"
            },
            "ringtimer": {
             "type": "integer"
            },
            "music_group_id": {
             "type": "integer"
            },
            "register": {},
            "dialstring": {},
            "trunk_cid": {
             "type": "string"
            },
            "overwrite_cid": {
             "type": "boolean"
            },
            "group_id": {},
            "group_mode": {
             "type": "string"
            },
            "outgoing_username": {
             "type": "string"
            },
            "incoming_username": {},
            "dial_string": {},
            "codecs": {},
            "nat": {
             "type": "string"
            },
            "dtmfmode": {
             "type": "string"
            },
            "simultaneous_calls": {
             "type": "integer"
            },
            "get_did_from": {},
            "get_cid_from": {
             "type": "string"
            },
            "mode": {
             "type": "string"
            },
            "register_flag": {
             "type": "boolean"
            },
            "disable": {
             "type": "boolean"
            },
            "continue_on_busy": {
             "type": "boolean"
            },
            "tenant_id": {
             "type": "integer"
            },
            "username": {
             "type": "string"
            },
            "channels": {
             "type": "array",
             "items": {}
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "examples": {
         "404_trunk_not_found": {
          "summary": "404 - Trunk not found",
          "value": {
           "status": "not_found",
           "message": "The requested trunk doesn't exists",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/trunks": {
   "get": {
    "tags": [
     "Trunks"
    ],
    "summary": "List trunks",
    "description": "Get all trunks",
    "operationId": "get_trunks",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_all_trunks_retrieved": {
          "summary": "200 - All trunks retrieved",
          "value": {
           "status": "success",
           "message": null,
           "data": [
            {
             "trunk_id": 1,
             "description": "Etisalna PBX",
             "technology": "SIP",
             "class_of_service_id": null,
             "dial_profile_id": 1,
             "tenant_trunk_id": null,
             "profile_id": 1,
             "ringtimer": 90,
             "music_group_id": 6,
             "register": null,
             "dialstring": null,
             "trunk_cid": "\"Etisalna PBX LLC\" <35925555${CS:0:3}>",
             "overwrite_cid": false,
             "group_id": null,
             "group_mode": "g",
             "outgoing_username": "eBD-Ombutel",
             "incoming_username": null,
             "dial_string": null,
             "codecs": null,
             "nat": "no",
             "dtmfmode": "auto",
             "simultaneous_calls": 10,
             "get_did_from": null,
             "get_cid_from": "contact",
             "mode": "visual",
             "register_flag": false,
             "disable": false,
             "continue_on_busy": true,
             "tenant_id": 1,
             "username": "eBD-Ombutel",
             "channels": []
            },
            {
             "trunk_id": 2,
             "description": "Dummy Trunk",
             "technology": "SIP",
             "class_of_service_id": null,
             "dial_profile_id": 1,
             "tenant_trunk_id": null,
             "profile_id": null,
             "ringtimer": 5,
             "music_group_id": 1,
             "register": null,
             "dialstring": null,
             "trunk_cid": "\"\" <>",
             "overwrite_cid": false,
             "group_id": null,
             "group_mode": "g",
             "outgoing_username": "SRV-A",
             "incoming_username": null,
             "dial_string": null,
             "codecs": null,
             "nat": "force_rport,comedia",
             "dtmfmode": "rfc2833",
             "simultaneous_calls": null,
             "get_did_from": null,
             "get_cid_from": null,
             "mode": "visual",
             "register_flag": false,
             "disable": true,
             "continue_on_busy": true,
             "tenant_id": 1,
             "username": "SRV-A",
             "channels": []
            },
            {
             "trunk_id": 7,
             "description": "OVPN CLOUD",
             "technology": "SIP",
             "class_of_service_id": null,
             "dial_profile_id": 1,
             "tenant_trunk_id": null,
             "profile_id": null,
             "ringtimer": 90,
             "music_group_id": 1,
             "register": null,
             "dialstring": null,
             "trunk_cid": "\"\" <>",
             "overwrite_cid": false,
             "group_id": null,
             "group_mode": "g",
             "outgoing_username": "MACHINE_A",
             "incoming_username": null,
             "dial_string": null,
             "codecs": null,
             "nat": null,
             "dtmfmode": "rfc2833",
             "simultaneous_calls": null,
             "get_did_from": null,
             "get_cid_from": null,
             "mode": "visual",
             "register_flag": false,
             "disable": false,
             "continue_on_busy": false,
             "tenant_id": 1,
             "username": "MACHINE_A",
             "channels": []
            },
            {
             "trunk_id": 8,
             "description": "OVPN_IAX",
             "technology": "IAX2",
             "class_of_service_id": 1,
             "dial_profile_id": 1,
             "tenant_trunk_id": null,
             "profile_id": 2,
             "ringtimer": 90,
             "music_group_id": 1,
             "register": null,
             "dialstring": null,
             "trunk_cid": "\"\" <>",
             "overwrite_cid": false,
             "group_id": null,
             "group_mode": "g",
             "outgoing_username": "OVPN_IAX",
             "incoming_username": null,
             "dial_string": null,
             "codecs": null,
             "nat": null,
             "dtmfmode": null,
             "simultaneous_calls": null,
             "get_did_from": null,
             "get_cid_from": null,
             "mode": "visual",
             "register_flag": false,
             "disable": false,
             "continue_on_busy": false,
             "tenant_id": 1,
             "username": "OVPN_IAX",
             "channels": []
            },
            {
             "trunk_id": 12,
             "description": "PJSIP Trunk",
             "technology": "PJSIP",
             "class_of_service_id": null,
             "dial_profile_id": 1,
             "tenant_trunk_id": null,
             "profile_id": 14,
             "ringtimer": 90,
             "music_group_id": 1,
             "register": null,
             "dialstring": null,
             "trunk_cid": "\"Telesoft\" <1234567890>",
             "overwrite_cid": true,
             "group_id": null,
             "group_mode": "g",
             "outgoing_username": "telnyx_demo",
             "incoming_username": null,
             "dial_string": null,
             "codecs": null,
             "nat": null,
             "dtmfmode": "rfc4733",
             "simultaneous_calls": null,
             "get_did_from": null,
             "get_cid_from": null,
             "mode": "visual",
             "register_flag": false,
             "disable": false,
             "continue_on_busy": false,
             "tenant_id": 1,
             "username": "telnyx_demo",
             "channels": []
            },
            {
             "trunk_id": 24,
             "description": "OpenVox",
             "technology": "SIP",
             "class_of_service_id": null,
             "dial_profile_id": 2,
             "tenant_trunk_id": null,
             "profile_id": null,
             "ringtimer": 90,
             "music_group_id": 1,
             "register": null,
             "dialstring": null,
             "trunk_cid": "\"88569536\" <88569536>",
             "overwrite_cid": true,
             "group_id": null,
             "group_mode": "g",
             "outgoing_username": "openvox",
             "incoming_username": null,
             "dial_string": null,
             "codecs": null,
             "nat": null,
             "dtmfmode": "rfc2833",
             "simultaneous_calls": null,
             "get_did_from": null,
             "get_cid_from": null,
             "mode": "visual",
             "register_flag": false,
             "disable": false,
             "continue_on_busy": false,
             "tenant_id": 1,
             "username": "openvox",
             "channels": []
            }
           ]
          }
         },
         "trunks": {
          "summary": "/trunks",
          "value": {
           "status": "success",
           "data": [
            {
             "trunk_id": 1,
             "description": "Etisalna PBX",
             "technology": "SIP",
             "class_of_service_id": null,
             "dial_profile_id": 1,
             "tenant_trunk_id": null,
             "ringtimer": 90,
             "music_group_id": 6,
             "register": null,
             "dialstring": null,
             "trunk_cid": "\"Etisalna PBX LLC\" <35925555${CS:0:3}>",
             "overwrite_cid": false,
             "group_id": null,
             "group_mode": "g",
             "outgoing_username": "eBD-Ombutel",
             "incoming_username": null,
             "dial_string": null,
             "codecs": null,
             "nat": "no",
             "simultaneous_calls": 10,
             "get_did_from": null,
             "get_cid_from": "contact",
             "mode": "visual",
             "register_flag": false,
             "disable": false,
             "continue_on_busy": true,
             "tenant_id": 1,
             "username": "eBD-Ombutel",
             "channels": []
            },
            {
             "trunk_id": 2,
             "description": "Dummy Trunk",
             "technology": "SIP",
             "class_of_service_id": null,
             "dial_profile_id": 1,
             "tenant_trunk_id": null,
             "ringtimer": 5,
             "music_group_id": 1,
             "register": null,
             "dialstring": null,
             "trunk_cid": "\"\" <>",
             "overwrite_cid": false,
             "group_id": null,
             "group_mode": "g",
             "outgoing_username": "SRV-A",
             "incoming_username": null,
             "dial_string": null,
             "codecs": null,
             "nat": "force_rport,comedia",
             "simultaneous_calls": null,
             "get_did_from": null,
             "get_cid_from": null,
             "mode": "visual",
             "register_flag": false,
             "disable": true,
             "continue_on_busy": true,
             "tenant_id": 1,
             "username": "SRV-A",
             "channels": []
            }
           ]
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "trunk_id": {
              "type": "integer"
             },
             "description": {
              "type": "string"
             },
             "technology": {
              "type": "string"
             },
             "class_of_service_id": {},
             "dial_profile_id": {
              "type": "integer"
             },
             "tenant_trunk_id": {},
             "profile_id": {
              "type": "integer"
             },
             "ringtimer": {
              "type": "integer"
             },
             "music_group_id": {
              "type": "integer"
             },
             "register": {},
             "dialstring": {},
             "trunk_cid": {
              "type": "string"
             },
             "overwrite_cid": {
              "type": "boolean"
             },
             "group_id": {},
             "group_mode": {
              "type": "string"
             },
             "outgoing_username": {
              "type": "string"
             },
             "incoming_username": {},
             "dial_string": {},
             "codecs": {},
             "nat": {
              "type": "string"
             },
             "dtmfmode": {
              "type": "string"
             },
             "simultaneous_calls": {
              "type": "integer"
             },
             "get_did_from": {},
             "get_cid_from": {
              "type": "string"
             },
             "mode": {
              "type": "string"
             },
             "register_flag": {
              "type": "boolean"
             },
             "disable": {
              "type": "boolean"
             },
             "continue_on_busy": {
              "type": "boolean"
             },
             "tenant_id": {
              "type": "integer"
             },
             "username": {
              "type": "string"
             },
             "channels": {
              "type": "array",
              "items": {}
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/users": {
   "get": {
    "tags": [
     "Users"
    ],
    "summary": "List users",
    "description": "Endpoint for finding Etisalna PBX's user by username.",
    "operationId": "get_users__",
    "parameters": [
     {
      "name": "username",
      "in": "query",
      "required": false,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_user_retrieved_by_username": {
          "summary": "200 - User retrieved by username",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "id": 1,
            "username": "admin",
            "email": null,
            "displayname": "Administrator",
            "department": "Administration",
            "locale": "en_US",
            "timezone": "system",
            "startapp": "mini_http_server",
            "dark_mode": true,
            "portaluser": false,
            "multitab": true,
            "enabled": true,
            "default": true
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "object",
           "properties": {
            "id": {
             "type": "integer"
            },
            "username": {
             "type": "string"
            },
            "email": {},
            "displayname": {
             "type": "string"
            },
            "department": {
             "type": "string"
            },
            "locale": {
             "type": "string"
            },
            "timezone": {
             "type": "string"
            },
            "startapp": {
             "type": "string"
            },
            "dark_mode": {
             "type": "boolean"
            },
            "portaluser": {
             "type": "boolean"
            },
            "multitab": {
             "type": "boolean"
            },
            "enabled": {
             "type": "boolean"
            },
            "default": {
             "type": "boolean"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/users/{id}": {
   "get": {
    "tags": [
     "Users"
    ],
    "summary": "Get user",
    "description": "",
    "operationId": "get_users_id",
    "parameters": [
     {
      "name": "id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "Record ID"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_retrieve_single_user": {
          "summary": "200 - Retrieve Single User",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "id": 1,
            "username": "admin",
            "email": null,
            "displayname": "Administrator",
            "department": "Administration",
            "locale": "en_US",
            "timezone": "system",
            "startapp": "mini_http_server",
            "dark_mode": true,
            "portaluser": false,
            "multitab": true,
            "enabled": true,
            "default": true
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "object",
           "properties": {
            "id": {
             "type": "integer"
            },
            "username": {
             "type": "string"
            },
            "email": {},
            "displayname": {
             "type": "string"
            },
            "department": {
             "type": "string"
            },
            "locale": {
             "type": "string"
            },
            "timezone": {
             "type": "string"
            },
            "startapp": {
             "type": "string"
            },
            "dark_mode": {
             "type": "boolean"
            },
            "portaluser": {
             "type": "boolean"
            },
            "multitab": {
             "type": "boolean"
            },
            "enabled": {
             "type": "boolean"
            },
            "default": {
             "type": "boolean"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "examples": {
         "404_user_not_found": {
          "summary": "404 - User Not Found",
          "value": {
           "status": "not_found",
           "message": "The requested user doesn't exist",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/virtual_faxes": {
   "get": {
    "tags": [
     "Virtual Faxes"
    ],
    "summary": "List virtual faxes",
    "description": "It retrieves all the faxes associated to the given tenant",
    "operationId": "get_virtual_faxes",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_all_faxes": {
          "summary": "200 - All Faxes",
          "value": {
           "status": "success",
           "message": null,
           "data": [
            {
             "id": 2,
             "description": "Another Fax",
             "cos_id": 4,
             "secret": "RD3RnYhVg3SyzEtNgM",
             "associated_email": "miguel@mycompany.com",
             "cid_name": "Jose Rivera",
             "cid_number": "87669536",
             "country_code": null,
             "area_code": null,
             "tenant_id": 1,
             "device_name": "ttyIAX2"
            }
           ]
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "integer"
             },
             "description": {
              "type": "string"
             },
             "cos_id": {
              "type": "integer"
             },
             "secret": {
              "type": "string"
             },
             "associated_email": {
              "type": "string"
             },
             "cid_name": {
              "type": "string"
             },
             "cid_number": {
              "type": "string"
             },
             "country_code": {},
             "area_code": {},
             "tenant_id": {
              "type": "integer"
             },
             "device_name": {
              "type": "string"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/virtual_faxes/{fax_id}": {
   "get": {
    "tags": [
     "Virtual Faxes"
    ],
    "summary": "Get virtual fax",
    "description": "It retrieves the configuration/information of a specific fax device.\n\nKeep in mind that the variable **1** represents the fax device ID.",
    "operationId": "get_virtual_faxes_fax_id",
    "parameters": [
     {
      "name": "fax_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "fax id"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_single_fax": {
          "summary": "200 - Single Fax",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "id": 2,
            "description": "Another Fax",
            "cos_id": 4,
            "secret": "RD3RnYhVg3SyzEtNgM",
            "associated_email": "miguel@mycompany.com",
            "cid_name": "Jose Rivera",
            "cid_number": "87669536",
            "country_code": null,
            "area_code": null,
            "tenant_id": 1,
            "device_name": "ttyIAX2"
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "object",
           "properties": {
            "id": {
             "type": "integer"
            },
            "description": {
             "type": "string"
            },
            "cos_id": {
             "type": "integer"
            },
            "secret": {
             "type": "string"
            },
            "associated_email": {
             "type": "string"
            },
            "cid_name": {
             "type": "string"
            },
            "cid_number": {
             "type": "string"
            },
            "country_code": {},
            "area_code": {},
            "tenant_id": {
             "type": "integer"
            },
            "device_name": {
             "type": "string"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/virtual_faxes/{fax_id}/send": {
   "post": {
    "tags": [
     "Virtual Faxes"
    ],
    "summary": "Send a fax",
    "description": "API endpoint for sending faxes. The file to be sent must be available online by URL.\n\nKeep in mind that the variable **1** represents the fax device ID.",
    "operationId": "post_virtual_faxes_fax_id_send",
    "parameters": [
     {
      "name": "fax_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "fax id"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "type": "object",
        "properties": {
         "url": {
          "type": "string",
          "description": "Full URL where the PDF to be sent is located at.",
          "example": "http://repo.mycompany.org/mycompany/brochures/Plan-CarrierPlusCC.pdf"
         },
         "recipients": {
          "type": "string",
          "description": "List of numbers separated by comma to which the fax will be sent to.",
          "example": "0100"
         },
         "resolution": {
          "type": "string",
          "description": "It forces the fax resolution to use. Possible values are standard, medium, or high.",
          "example": "medium"
         },
         "retries": {
          "type": "string",
          "description": "It allows defining the maximum number of allowed tries for sending fax after failing, not including the initial attempt.",
          "example": "2"
         },
         "retry_time": {
          "type": "string",
          "description": "How many seconds to wait before retry. The default is 300 (5 minutes).",
          "example": "300"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_fax_sent": {
          "summary": "200 - Fax Sent",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "device": "ttyIAX2",
            "recipients": [
             "0100"
            ],
            "file": "/var/lib/mycompany/fax/tmp/1615833164.2566.pdf",
            "email": "miguel@mycompany.com",
            "status": "Waiting for modem to come free\n"
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "object",
           "properties": {
            "device": {
             "type": "string"
            },
            "recipients": {
             "type": "array",
             "items": {
              "type": "string"
             }
            },
            "file": {
             "type": "string"
            },
            "email": {
             "type": "string"
            },
            "status": {
             "type": "string"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/virtual_faxes/log/{fax_log_id}": {
   "get": {
    "tags": [
     "Virtual Faxes"
    ],
    "summary": "Get fax log entry",
    "description": "It allows you to retrieve detailed information about a sent/received fax; This is the same information you can see on the Etisalna PBX's Fax Viewer module.",
    "operationId": "get_virtual_faxes_log_fax_log_id",
    "parameters": [
     {
      "name": "fax_log_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "fax log id"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_log_retrieved": {
          "summary": "200 - Log Retrieved",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "unix_date": "1626153003",
            "device_id": 2,
            "device": "Main Fax",
            "type": "Outgoing",
            "sender": "\"Etisalna PBX LLC\" <87669536>",
            "recipient": "0100",
            "file": "1626153001.5126.pdf",
            "status": "Failed",
            "error": "The call dropped prematurely"
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "object",
           "properties": {
            "unix_date": {
             "type": "string"
            },
            "device_id": {
             "type": "integer"
            },
            "device": {
             "type": "string"
            },
            "type": {
             "type": "string"
            },
            "sender": {
             "type": "string"
            },
            "recipient": {
             "type": "string"
            },
            "file": {
             "type": "string"
            },
            "status": {
             "type": "string"
            },
            "error": {
             "type": "string"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/voicemail/{extension}/{folder}/{message}": {
   "delete": {
    "tags": [
     "Voicemail"
    ],
    "summary": "Delete voicemail message",
    "description": "Delete an extension's voicemail recording from an specific folder",
    "operationId": "delete_voicemail_extension_folder_message",
    "parameters": [
     {
      "name": "extension",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "extension"
     },
     {
      "name": "folder",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "folder"
     },
     {
      "name": "message",
      "in": "path",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "message"
     }
    ],
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "200_voicemail_deleted": {
          "summary": "200 - Voicemail Deleted",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "Old": [
             {
              "date": "1572966035",
              "clid": "Person 01<2001>",
              "priority": "2",
              "vmorig": "2000",
              "duration": "14",
              "recfile": "/static/43b4298b09648469/voicemail/mycompany-voicemail/2000/Old/msg4372.wav",
              "filename": "msg4372.txt"
             },
             {
              "date": "1516919532",
              "clid": "X-Lite<7502>",
              "priority": "2",
              "vmorig": "2000",
              "duration": "8",
              "recfile": "/static/43b4298b09648469/voicemail/mycompany-voicemail/2000/Old/msg0001.wav",
              "filename": "msg0001.txt"
             }
            ]
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "object",
           "properties": {
            "Old": {
             "type": "array",
             "items": {
              "type": "object",
              "properties": {
               "date": {
                "type": "string"
               },
               "clid": {
                "type": "string"
               },
               "priority": {
                "type": "string"
               },
               "vmorig": {
                "type": "string"
               },
               "duration": {
                "type": "string"
               },
               "recfile": {
                "type": "string"
               },
               "filename": {
                "type": "string"
               }
              }
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/whatsapp/numbers": {
   "get": {
    "tags": [
     "Whatsapp"
    ],
    "summary": "List WhatsApp numbers",
    "description": "It retrieves all the numbers from all the conections created in a specific tenant. The response returns an array of objects with the attributes below.\n\n| Parameter | **Type** | Description |\n| --- | --- | --- |\n| id | string | The unique ID attached to the number; this can be use to perform any action related to number endpoints. |\n| number | string | The whatsapp's number. |\n| description | string | The name or description for the whatsapp's number. |",
    "operationId": "get_whatsapp_numbers",
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "all_numbers_retrieved": {
          "summary": "All Numbers Retrieved",
          "value": {
           "status": "success",
           "message": null,
           "data": [
            {
             "id": "f0ae9f7d-13e0-4cf9-8ffe-171844564256",
             "number": "+15551004538",
             "description": "Test Number"
            }
           ]
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "array",
           "items": {
            "type": "object",
            "properties": {
             "id": {
              "type": "string"
             },
             "number": {
              "type": "string"
             },
             "description": {
              "type": "string"
             }
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/whatsapp/numbers/{wa_number_id}/messages": {
   "post": {
    "tags": [
     "Whatsapp"
    ],
    "summary": "Send a WhatsApp message",
    "description": "It sends a Whatsapp message and returns the message ID to monitor their status.\n\nThe parameters for the body requests are the ones below.\n\n| Parameter | Type | Descritption |\n| --- | --- | --- |\n| to | string | The recipient number. It must be a valid E.164 number. e.g.: +13051114444. |\n| type | string | Indicates message type. The possible values are text, location, template, image, video, document, sticker, audio. |\n| text | object | Text messages contents. |\n| image | object | Media message contents. The property name should match the type of media message you are sending (image for an image message, video for a video message, etc.). |\n| location | object | Location message contents. |\n| contacts | object | Contacts message contents. |\n\n#### Sending Media Messages\n\nWhen sending media messages, we must first upload the media using the \"media\" endpoint that will return an ID that can be use in the media objects(image, video, document, audio, and sticker). If you don't want to upload the media files, then you must provide a valid link publicly accessible.",
    "operationId": "post_whatsapp_numbers_wa_number_id_messages",
    "parameters": [
     {
      "name": "wa_number_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "wa number id"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "application/json": {
       "schema": {
        "type": "object",
        "properties": {
         "to": {
          "type": "string"
         },
         "type": {
          "type": "string"
         },
         "text": {
          "type": "object",
          "properties": {
           "body": {
            "type": "string"
           }
          }
         }
        }
       },
       "example": {
        "to": "966500000000",
        "type": "text",
        "text": {
         "body": "Hello from Etisalna PBX API!"
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "text_message": {
          "summary": "Text Message",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "msg_id": "wamid.HBgLNTA1ODc2Njk1MzYVAgARGBI4MzFFODVCQkZCQzc1ODM1NDQA"
           }
          }
         },
         "location": {
          "summary": "Location",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "msg_id": "wamid.HBgLNTA1ODc2Njk1MzYVAgARGBJBQzdBMDMzNjlFMzE3NTMzOEUA"
           }
          }
         },
         "contacts": {
          "summary": "Contacts",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "msg_id": "wamid.HBgLNTA1ODc2Njk1MzYVAgARGBJFNzgxQjE4MTBBN0VGNEEwMzUA"
           }
          }
         },
         "media": {
          "summary": "Media",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "msg_id": "wamid.HBgLNTA1ODc2Njk1MzYVAgARGBIxNkFGQUJDNDg2QkVEOTI5MEMA"
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "object",
           "properties": {
            "msg_id": {
             "type": "string"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     },
     "404": {
      "description": "Not Found",
      "content": {
       "application/json": {
        "examples": {
         "invalid_number_id": {
          "summary": "Invalid Number ID",
          "value": {
           "status": "not_found",
           "message": "The ID f0ae9f7d-13e0-4cf9-8ffe-172222264256 doesn't belong to any number",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     },
     "422": {
      "description": "Unprocessable Entity",
      "content": {
       "application/json": {
        "examples": {
         "invalid_payload": {
          "summary": "Invalid Payload",
          "value": {
           "status": "error",
           "message": "The payload doesn't contain the property 'type'!",
           "data": []
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {
           "type": "string"
          },
          "data": {
           "type": "array",
           "items": {}
          }
         }
        }
       }
      }
     }
    }
   }
  },
  "/whatsapp/numbers/{wa_number_id}/media": {
   "post": {
    "tags": [
     "Whatsapp"
    ],
    "summary": "Upload WhatsApp media",
    "description": "It allows you to upload a media file that can be use on media messages.",
    "operationId": "post_whatsapp_numbers_wa_number_id_media",
    "parameters": [
     {
      "name": "wa_number_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "wa number id"
     }
    ],
    "requestBody": {
     "required": true,
     "content": {
      "multipart/form-data": {
       "schema": {
        "type": "object",
        "properties": {
         "file": {
          "type": "string",
          "format": "binary"
         }
        }
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "OK",
      "content": {
       "application/json": {
        "examples": {
         "media_uploaded": {
          "summary": "Media Uploaded",
          "value": {
           "status": "success",
           "message": null,
           "data": {
            "id": "840900320816550"
           }
          }
         }
        },
        "schema": {
         "type": "object",
         "properties": {
          "status": {
           "type": "string"
          },
          "message": {},
          "data": {
           "type": "object",
           "properties": {
            "id": {
             "type": "string"
            }
           }
          }
         }
        }
       }
      }
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  },
  "/whatsapp/messages/{wa_msg_id}/media": {
   "get": {
    "tags": [
     "Whatsapp"
    ],
    "summary": "Download media of an incoming message",
    "description": "It allows you to download the media from the incoming media messages.",
    "operationId": "get_whatsapp_messages_wa_msg_id_media",
    "parameters": [
     {
      "name": "wa_msg_id",
      "in": "path",
      "required": true,
      "schema": {
       "type": "integer"
      },
      "description": "wa msg id"
     }
    ],
    "responses": {
     "200": {
      "description": "Success"
     },
     "401": {
      "$ref": "#/components/responses/Unauthorized"
     }
    }
   }
  }
 },
 "components": {
  "securitySchemes": {
   "appKey": {
    "type": "apiKey",
    "in": "header",
    "name": "app-key",
    "description": "Your company API key (issued by Etisalna). It only gives access to your own company data."
   }
  },
  "responses": {
   "Unauthorized": {
    "description": "Missing, wrong or disabled API key",
    "content": {
     "application/json": {
      "example": {
       "status": "declined",
       "message": "Access Denied"
      }
     }
    }
   }
  }
 }
}