{
  "openapi": "3.1.0",
  "info": {
    "title": "Webhooks",
    "version": "1.0.0",
    "description": "# VOXO Webhooks\n\nThis collection documents the webhook events available in the VOXO platform. Webhooks allow your application to receive real-time HTTP POST notifications when specific events occur in your VOXO account.\n\nAll webhook payloads are sent as POST requests to your configured `WEBHOOK_URL`.\n\n## Available Webhook Events\n\n| Event | Type Identifier | Description |\n| --- | --- | --- |\n| **Start Call** | `STARTCALL` | Fires when a new call begins |\n| **Answered Call** | `ANSWEREDCALL` | Fires when a call is answered |\n| **End Call** | `ENDCALL` | Fires when a call ends |\n| **Call Recording** | `CALLRECORDING` | Fires when a new recording is available |\n| **New Voicemail** | `NEWVOICEMAIL` | Fires when a voicemail is left for any mailbox |\n| **SMS Received** | `INBOUNDSMS` | Fires when an inbound SMS is received on any number |\n| **Fax Received** | `FAXRECEIVED` | Fires when a new fax is received |\n| **Extension Created** | `EXTENSIONCREATED` | Fires when a new extension is created |\n| **Extension Deleted** | `EXTENSIONDELETED` | Fires when an extension is deleted |\n\n## Notes\n\n- All datetime values are provided in **ISO 8601** format.\n    \n- Each request in this collection includes a detailed description of its payload parameters."
  },
  "servers": [
    {
      "url": "https://example.com"
    }
  ],
  "webhooks": {
    "ANSWEREDCALL": {
      "post": {
        "summary": "Answered Call",
        "responses": {
          "200": {
            "description": "200 OK"
          }
        },
        "description": "This webhook fires when a new call is answered in your account.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "to": {
                    "type": "string",
                    "format": "utc-millisec"
                  },
                  "from": {
                    "type": "string",
                    "format": "utc-millisec"
                  },
                  "time": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "callId": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "to": "5555555555",
                "from": "5555555551",
                "time": "2024-08-21T13:12:00-05:00",
                "callId": "ABCDEFG"
              }
            }
          }
        }
      }
    },
    "ENDCALL": {
      "post": {
        "summary": "End Call",
        "responses": {
          "200": {
            "description": "200 OK"
          }
        },
        "description": "This webhook fires when a call ends for your account.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "callId": {
                    "type": "string"
                  },
                  "tenantId": {
                    "type": "integer"
                  },
                  "direction": {
                    "type": "string"
                  },
                  "start": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "answeredAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "cidNum": {
                    "type": "string"
                  },
                  "cidName": {
                    "type": "string"
                  },
                  "dialedNum": {
                    "type": "string"
                  },
                  "uniqueId": {
                    "type": "string"
                  },
                  "disposition": {
                    "type": "string"
                  },
                  "end": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "isTollfree": {
                    "type": "integer"
                  },
                  "dialedName": {
                    "type": "string"
                  },
                  "presented": {
                    "type": "integer"
                  },
                  "isInternational": {
                    "type": "integer"
                  },
                  "geolocation": {
                    "type": "string"
                  },
                  "queueCall": {
                    "type": "integer"
                  },
                  "billingId": {
                    "type": "string",
                    "format": "utc-millisec"
                  },
                  "partnerId": {
                    "type": "integer"
                  },
                  "mos": {
                    "type": "string"
                  },
                  "jurisdiction": {
                    "type": "object"
                  },
                  "events": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string"
                        },
                        "timestamp": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "data": {
                          "type": "object"
                        }
                      }
                    }
                  },
                  "voicemail": {
                    "type": "integer"
                  },
                  "isTransferred": {
                    "type": "integer"
                  },
                  "isRecorded": {
                    "type": "integer"
                  },
                  "tag": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "callId": "ABCDEFG",
                "tenantId": 24,
                "direction": "inbound",
                "start": "2024-08-21T13:10:00-05:00",
                "answeredAt": "2024-08-21T13:10:05-05:00",
                "cidNum": "5555555555",
                "cidName": "Fred Durst",
                "dialedNum": "5555555551",
                "uniqueId": "1724263800.1234",
                "disposition": "ANSWERED",
                "end": "2024-08-21T13:12:00-05:00",
                "isTollfree": 0,
                "dialedName": "Frederick Durst",
                "presented": 1,
                "isInternational": 0,
                "geolocation": "31.6928449,-89.0722731",
                "queueCall": 1,
                "billingId": "12345",
                "partnerId": 10,
                "mos": "4.4",
                "jurisdiction": {},
                "events": [
                  {
                    "type": "answer",
                    "timestamp": "2024-08-21T18:10:05.000Z",
                    "data": {}
                  }
                ],
                "voicemail": 0,
                "isTransferred": 0,
                "isRecorded": 1,
                "tag": "Musik"
              }
            }
          }
        }
      }
    },
    "FAXRECEIVED": {
      "post": {
        "summary": "Fax Received",
        "responses": {
          "200": {
            "description": "200 OK"
          }
        },
        "description": "This webhook fires when a new fax is received to your account.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "faxId": {
                    "type": "integer"
                  },
                  "url": {
                    "type": "string",
                    "format": "uri"
                  },
                  "time": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "from": {
                    "type": "string",
                    "format": "utc-millisec"
                  },
                  "to": {
                    "type": "string",
                    "format": "utc-millisec"
                  },
                  "pages": {
                    "type": "string",
                    "format": "utc-millisec"
                  }
                }
              },
              "example": {
                "faxId": 12345,
                "url": "https:/you.ayed/12345",
                "time": "2024-08-21T13:12:00-05:00",
                "from": "5555555555",
                "to": "5555555551",
                "pages": "4"
              }
            }
          }
        }
      }
    },
    "NEWVOICEMAIL": {
      "post": {
        "summary": "New Voicemail",
        "responses": {
          "200": {
            "description": "200 OK"
          }
        },
        "description": "This webhook fires when a new voicemail is left for any mailbox in your account. Time are posted as ISO format.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "transcript": {
                    "type": "string"
                  },
                  "mailboxName": {
                    "type": "string"
                  },
                  "tenantId": {
                    "type": "integer"
                  },
                  "duration": {
                    "type": "integer"
                  },
                  "mailboxNumber": {
                    "type": "string",
                    "format": "utc-millisec"
                  },
                  "messageNum": {
                    "type": "integer"
                  },
                  "callerIdNumber": {
                    "type": "string",
                    "format": "utc-millisec"
                  },
                  "dateTime": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "context": {
                    "type": "string",
                    "format": "utc-millisec"
                  }
                }
              },
              "example": {
                "transcript": "This is a transcript",
                "mailboxName": "Ham",
                "tenantId": 24,
                "duration": 57,
                "mailboxNumber": "1001",
                "messageNum": 1234,
                "callerIdNumber": "5555555555",
                "dateTime": "2024-08-21T13:12:00-05:00",
                "context": "24"
              }
            }
          }
        }
      }
    },
    "INBOUNDSMS": {
      "post": {
        "summary": "SMS Received",
        "responses": {
          "200": {
            "description": "200 OK"
          }
        },
        "description": "This webhook fires when a new message is received for any number in your account.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "tenantId": {
                    "type": "integer"
                  },
                  "userId": {
                    "type": "integer"
                  },
                  "to": {
                    "type": "string",
                    "format": "utc-millisec"
                  },
                  "toExt": {
                    "type": "string",
                    "format": "utc-millisec"
                  },
                  "from": {
                    "type": "string",
                    "format": "utc-millisec"
                  },
                  "conversationId": {
                    "type": "integer"
                  },
                  "message": {
                    "type": "string"
                  },
                  "messageId": {
                    "type": "integer"
                  },
                  "time": {
                    "type": "string",
                    "format": "date-time"
                  }
                }
              },
              "example": {
                "tenantId": 24,
                "userId": 12,
                "to": "5555555555",
                "toExt": "1256",
                "from": "5555555551",
                "conversationId": 10,
                "message": "I heard yalls muzik",
                "messageId": 22,
                "time": "2024-08-21T13:12:00-05:00"
              }
            }
          }
        }
      }
    },
    "STARTCALL": {
      "post": {
        "summary": "Start Call",
        "responses": {
          "200": {
            "description": "200 OK"
          }
        },
        "description": "This webhook fires when a new call begins for your account.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "callId": {
                    "type": "string"
                  },
                  "start": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "tenantId": {
                    "type": "string",
                    "format": "utc-millisec"
                  },
                  "cidNum": {
                    "type": "string",
                    "format": "utc-millisec"
                  },
                  "cidName": {
                    "type": "string"
                  },
                  "dialedNum": {
                    "type": "string",
                    "format": "utc-millisec"
                  },
                  "direction": {
                    "type": "string"
                  }
                }
              },
              "example": {
                "callId": "ABCDEFG",
                "start": "2024-08-21T13:12:00-05:00",
                "tenantId": "24",
                "cidNum": "5555555555",
                "cidName": "Frederick Durst",
                "dialedNum": "5555555551",
                "direction": "OUT"
              }
            }
          }
        }
      }
    },
    "EXTENSIONCREATED": {
      "post": {
        "summary": "Extension Created",
        "responses": {
          "200": {
            "description": "200 OK"
          }
        },
        "description": "This webhook fires when a new extension is created in your account.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "tenantId": {
                    "type": "integer"
                  },
                  "extensionId": {
                    "type": "integer"
                  },
                  "number": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "extensionType": {
                    "type": "string"
                  },
                  "email": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "callerIdNumber": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "branchId": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "peerName": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "recording": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "date": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "time": {
                    "type": "string",
                    "format": "date-time"
                  }
                }
              },
              "example": {
                "tenantId": 24,
                "extensionId": 456,
                "number": "1001",
                "name": "Frederick Durst",
                "extensionType": "sip",
                "email": "fred@example.com",
                "callerIdNumber": "5555555555",
                "branchId": 1,
                "peerName": "OIVR_24_1001",
                "recording": 1,
                "date": "2024-08-21T13:12:00-05:00",
                "time": "2024-08-21T13:12:00-05:00"
              }
            }
          }
        }
      }
    },
    "EXTENSIONDELETED": {
      "post": {
        "summary": "Extension Deleted",
        "responses": {
          "200": {
            "description": "200 OK"
          }
        },
        "description": "This webhook fires when an extension is deleted from your account.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "tenantId": {
                    "type": "integer"
                  },
                  "extensionId": {
                    "type": "integer"
                  },
                  "number": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "extensionType": {
                    "type": "string"
                  },
                  "email": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "callerIdNumber": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "branchId": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "peerName": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "recording": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "date": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "time": {
                    "type": "string",
                    "format": "date-time"
                  }
                }
              },
              "example": {
                "tenantId": 24,
                "extensionId": 456,
                "number": "1001",
                "name": "Frederick Durst",
                "extensionType": "sip",
                "email": "fred@example.com",
                "callerIdNumber": "5555555555",
                "branchId": 1,
                "peerName": "OIVR_24_1001",
                "recording": 1,
                "date": "2024-08-21T13:12:00-05:00",
                "time": "2024-08-21T13:12:00-05:00"
              }
            }
          }
        }
      }
    },
    "CALLRECORDING": {
      "post": {
        "summary": "Call Recording",
        "responses": {
          "200": {
            "description": "200 OK"
          }
        },
        "description": "This webhook fires when a new recording is available in your account.",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "start": {
                    "type": "string"
                  },
                  "tenantId": {
                    "type": "integer"
                  },
                  "direction": {
                    "type": "string"
                  },
                  "callerIdNum": {
                    "type": "string"
                  },
                  "callerIdName": {
                    "type": "string"
                  },
                  "dialedNum": {
                    "type": "string"
                  },
                  "disposition": {
                    "type": "string"
                  },
                  "duration": {
                    "type": "integer"
                  },
                  "uniqueId": {
                    "type": "string"
                  },
                  "whoAnswered": {
                    "type": "string"
                  },
                  "packetLoss": {
                    "type": "number"
                  },
                  "rxCount": {
                    "type": "integer"
                  },
                  "txCount": {
                    "type": "integer"
                  },
                  "rtt": {
                    "type": "integer"
                  },
                  "qos": {
                    "type": "integer"
                  },
                  "percentJitter": {
                    "type": "number"
                  },
                  "prevUniqueId": {
                    "type": "string"
                  },
                  "queueCall": {
                    "type": "integer"
                  },
                  "recorded": {
                    "type": "integer"
                  },
                  "presented": {
                    "type": "integer"
                  },
                  "nextUniqueId": {
                    "type": "string"
                  },
                  "callOutcome": {
                    "type": "string"
                  },
                  "afterAnswerDuration": {
                    "type": "integer"
                  },
                  "outgoingCidNum": {
                    "type": "string"
                  },
                  "billingId": {
                    "type": "string"
                  },
                  "partnerId": {
                    "type": "integer"
                  },
                  "geolocation": {
                    "type": "string"
                  },
                  "transcriptionId": {
                    "type": "string"
                  },
                  "dialedName": {
                    "type": "string"
                  },
                  "callId": {
                    "type": "string"
                  },
                  "ani": {
                    "type": "string"
                  },
                  "ocn": {
                    "type": "string"
                  },
                  "lata": {
                    "type": "string"
                  },
                  "city": {
                    "type": "string"
                  },
                  "rateCenter": {
                    "type": "string"
                  },
                  "state": {
                    "type": "string"
                  },
                  "jurisdiction": {
                    "type": "string"
                  },
                  "local": {
                    "type": "integer"
                  },
                  "lec": {
                    "type": "string"
                  },
                  "lecType": {
                    "type": "string"
                  },
                  "spid": {
                    "type": "string"
                  },
                  "mos": {
                    "type": "number"
                  },
                  "recordingUrl": {
                    "type": "string",
                    "format": "uri"
                  }
                }
              },
              "example": {
                "start": "2024-08-21 13:10:00",
                "tenantId": 24,
                "direction": "OUT",
                "callerIdNum": "1001",
                "callerIdName": "Jane Doe",
                "dialedNum": "5551234567",
                "disposition": "ANSWERED",
                "duration": 180,
                "uniqueId": "example-media-abc12345-wxyz-1700000000.1234567",
                "whoAnswered": "5551234567",
                "packetLoss": 0.3,
                "rxCount": 12000,
                "txCount": 11800,
                "rtt": 28,
                "qos": 1,
                "percentJitter": 0.45,
                "prevUniqueId": "",
                "queueCall": 0,
                "recorded": 1,
                "presented": 1,
                "nextUniqueId": "",
                "callOutcome": "",
                "afterAnswerDuration": 179,
                "outgoingCidNum": "5559876543",
                "billingId": "100",
                "partnerId": 1,
                "geolocation": "",
                "transcriptionId": "",
                "dialedName": "ACME",
                "callId": "abc123def456ghi789",
                "ani": "5551234567",
                "ocn": "1234",
                "lata": "722",
                "city": "ANYTOWN",
                "rateCenter": "ANYTOWN",
                "state": "TX",
                "jurisdiction": "INTERSTATE",
                "local": 0,
                "lec": "EXAMPLE TELECOM, LLC - TX",
                "lecType": "CLEC",
                "spid": "123A",
                "mos": 4.25,
                "recordingUrl": "https://example.com/recordings/sample-recording.mp3"
              }
            }
          }
        }
      }
    }
  }
}