{
  "openapi": "3.1.0",
  "info": {
    "title": "A1ROUTES BusinessPhoneSystem (A1PBX)",
    "version": "1.0.0",
    "description": "Customer API reference. Confirm account availability and deployed response formats before production use."
  },
  "servers": [
    {
      "url": "https://{accountid}.a1routes.com/app/api/7",
      "variables": {
        "accountid": {
          "default": "YOUR_ACCOUNT_ID",
          "description": "Assigned account identifier; numeric or company name. Preserve leading zeros."
        }
      }
    }
  ],
  "paths": {
    "/originate": {
      "get": {
        "operationId": "originate",
        "summary": "Originate a call",
        "description": "Connect an existing extension to a destination number for CRM click-to-call workflows. This GET initiates a real call. Never prefetch or automatically retry.",
        "tags": [
          "BusinessPhoneSystem"
        ],
        "parameters": [
          {
            "name": "extension",
            "in": "query",
            "required": true,
            "description": "Existing extension authorized for this API account.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "destination",
            "in": "query",
            "required": true,
            "description": "Destination permitted by your account calling policy.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "default": {
            "description": "Inspect HTTP status and content type. Exact success/error schemas must be verified for the assigned account."
          }
        }
      }
    },
    "/view_call_recordings": {
      "get": {
        "operationId": "recordings",
        "summary": "List call recordings",
        "description": "Find recorded calls available to your A1PBX API account.",
        "tags": [
          "BusinessPhoneSystem"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Requested number of results. Confirm the allowed maximum for your account.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Pagination position. Confirm offset semantics for your deployed API before incrementing it.",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "default": {
            "description": "Inspect HTTP status and content type. Exact success/error schemas must be verified for the assigned account."
          }
        }
      }
    },
    "/call_recording": {
      "get": {
        "operationId": "recording",
        "summary": "Download a recording",
        "description": "Retrieve the audio of an accessible recorded call by its recording identifier.",
        "tags": [
          "BusinessPhoneSystem"
        ],
        "parameters": [
          {
            "name": "uuid",
            "in": "query",
            "required": true,
            "description": "Recording identifier obtained from an authorized recording result.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Explicitly request binary or base64. Availability depends on your deployed version.",
            "schema": {
              "type": "string",
              "enum": [
                "binary",
                "base64"
              ]
            }
          }
        ],
        "responses": {
          "default": {
            "description": "Inspect HTTP status and content type. Exact success/error schemas must be verified for the assigned account."
          }
        }
      }
    },
    "/xml_cdr": {
      "get": {
        "operationId": "cdr",
        "summary": "List call history",
        "description": "Retrieve call detail records for reporting and integration with your business systems.",
        "tags": [
          "BusinessPhoneSystem"
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Requested result count; account limits may apply.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "required": false,
            "description": "Pagination position; verify the deployed API semantics.",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "order_by",
            "in": "query",
            "required": false,
            "description": "Sort expression, for example start_epoch desc.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "start_stamp[]",
            "in": "query",
            "required": false,
            "description": "Repeat this parameter for the start and end of a date range. Confirm account timezone and boundary behavior.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              },
              "minItems": 2,
              "maxItems": 2
            },
            "style": "form",
            "explode": true
          }
        ],
        "responses": {
          "default": {
            "description": "Inspect HTTP status and content type. Exact success/error schemas must be verified for the assigned account."
          }
        }
      }
    },
    "/xml_cdr/{uuid}": {
      "get": {
        "operationId": "call",
        "summary": "Get a call record",
        "description": "Retrieve one call detail record accessible to your account.",
        "tags": [
          "BusinessPhoneSystem"
        ],
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "description": "Call record identifier obtained from the call history endpoint.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "default": {
            "description": "Inspect HTTP status and content type. Exact success/error schemas must be verified for the assigned account."
          }
        }
      }
    },
    "/voicemail_messages": {
      "get": {
        "operationId": "voicemails",
        "summary": "List voicemail messages",
        "description": "Retrieve messages from mailboxes your integration is authorized to access.",
        "tags": [
          "BusinessPhoneSystem"
        ],
        "parameters": [],
        "responses": {
          "default": {
            "description": "Inspect HTTP status and content type. Exact success/error schemas must be verified for the assigned account."
          }
        }
      }
    },
    "/voicemail_messages/{uuid}": {
      "get": {
        "operationId": "voicemail",
        "summary": "Retrieve voicemail audio",
        "description": "Retrieve an authorized voicemail message, including its available audio.",
        "tags": [
          "BusinessPhoneSystem"
        ],
        "parameters": [
          {
            "name": "uuid",
            "in": "path",
            "required": true,
            "description": "Voicemail message identifier obtained from an authorized message listing.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "default": {
            "description": "Inspect HTTP status and content type. Exact success/error schemas must be verified for the assigned account."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "description": "Entire header value: Basic YOUR_A1PBX_API_KEY. Literal key after Basic; confirm deployment support."
      }
    }
  },
  "security": [
    {
      "ApiKey": []
    }
  ]
}