Avoca Enterprise API

Read access to Avoca calls, transcripts, leads, teams, coach/QA evaluations, scheduler sessions and bookings, funnel/UTM/service-area analytics, and outbound texting feeds. Bearer API-key authentication (avoca_) with per-key permission scopes and team scoping. Includes HMAC-SHA256 signed event webhooks and a Speed-to-Lead intake webhook.

OpenAPI Specification

avoca-openapi-original.json Raw ↑
{
  "openapi": "3.1.0",
  "info": {
    "title": "Avoca Enterprise API",
    "description": "Read-only programmatic access to Avoca data: calls, transcripts, leads, coach evaluations, Simple Scheduler sessions and analytics, and outbound texting activity.",
    "version": "1.3.0"
  },
  "servers": [
    {
      "url": "https://enterprise-api.avoca.ai"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "tags": [
    {
      "name": "Calls",
      "description": "Call records, transcripts, and pre-call transfers"
    },
    {
      "name": "Leads",
      "description": "Unified leads (v0) and the canonical leads feed (v1)"
    },
    {
      "name": "Teams",
      "description": "Teams accessible to the API key"
    },
    {
      "name": "Coach",
      "description": "Coach (QA) call evaluations and rubrics"
    },
    {
      "name": "Scheduler Analytics (v0)",
      "description": "Simple Scheduler analytics — legacy flat endpoints"
    },
    {
      "name": "Sessions & Bookings",
      "description": "v1 scheduling-widget sessions and completed bookings"
    },
    {
      "name": "Analytics (v1)",
      "description": "v1 funnel, UTM, service-area, and issue-type analytics"
    },
    {
      "name": "Outbound Texting",
      "description": "Campaign text and subscription-event feeds for BI ingestion"
    }
  ],
  "paths": {
    "/api/calls": {
      "get": {
        "tags": [
          "Calls"
        ],
        "summary": "List calls",
        "description": "List calls for the authenticated team. The exact columns returned are governed by the team's configured column allowlist. Requires the `read:calls` permission.",
        "operationId": "listCalls",
        "parameters": [
          {
            "$ref": "#/components/parameters/xTeamId"
          },
          {
            "$ref": "#/components/parameters/limit1000"
          },
          {
            "$ref": "#/components/parameters/offset"
          },
          {
            "$ref": "#/components/parameters/startDate7d"
          },
          {
            "$ref": "#/components/parameters/endDateNow"
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of calls",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Call"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/OffsetPagination"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/api/calls/{id}": {
      "get": {
        "tags": [
          "Calls"
        ],
        "summary": "Get a call",
        "description": "Get a specific call by ID. Requires the `read:calls` permission.",
        "operationId": "getCall",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The call ID (UUID)",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/xTeamId"
          }
        ],
        "responses": {
          "200": {
            "description": "The call",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Call"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/api/calls/{id}/transcript": {
      "get": {
        "tags": [
          "Calls"
        ],
        "summary": "Get a call transcript",
        "description": "Get the transcript for a specific call. Requires the `read:transcripts` permission.",
        "operationId": "getCallTranscript",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "The call ID (UUID)",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "$ref": "#/components/parameters/xTeamId"
          }
        ],
        "responses": {
          "200": {
            "description": "The transcript as ordered role/content turns",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "call_id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "transcript": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "role": {
                                "type": "string",
                                "enum": [
                                  "assistant",
                                  "user"
                                ]
                              },
                              "content": {
                                "type": "string"
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/api/calls/latest-by-phone": {
      "get": {
        "tags": [
          "Calls"
        ],
        "summary": "Get latest call by phone number",
        "description": "Get the most recent call for a phone number. Requires the `read:calls` permission.",
        "operationId": "getLatestCallByPhone",
        "parameters": [
          {
            "name": "phone",
            "in": "query",
            "required": true,
            "description": "Phone number to search",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/xTeamId"
          }
        ],
        "responses": {
          "200": {
            "description": "The most recent matching call",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Call"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/api/calls/pre-call-transfers": {
      "get": {
        "tags": [
          "Calls"
        ],
        "summary": "List pre-call transfers",
        "description": "List inbound calls that were forwarded to a configured destination *before* the AI agent picked up, based on the team's pre-call transfer rules. These calls have `duration_seconds: 0` because the AI never engaged. Returns a fixed shape and does not honor the team's column allowlist. Requires the `read:calls` permission.",
        "operationId": "listPreCallTransfers",
        "parameters": [
          {
            "$ref": "#/components/parameters/xTeamId"
          },
          {
            "$ref": "#/components/parameters/limit1000"
          },
          {
            "$ref": "#/components/parameters/offset"
          },
          {
            "$ref": "#/components/parameters/startDate7d"
          },
          {
            "$ref": "#/components/parameters/endDateNow"
          },
          {
            "name": "rule_types",
            "in": "query",
            "description": "Comma-separated rule types to filter by. One or more of: `REJECTED_AGENT_PREVIOUSLY`, `RECENT_CALLER`, `UPCOMING_APPOINTMENTS`, `RECENT_APPOINTMENTS`, `CUSTOMER_TYPE_RESIDENTIAL`, `CUSTOMER_TYPE_COMMERCIAL`, `CALLER_PHONE_MATCH`, `CALL_REASON_MATCH`, `CUSTOMER_TAG_MATCH`.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of pre-call transfers",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/PreCallTransfer"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/OffsetPagination"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/api/leads": {
      "get": {
        "tags": [
          "Leads"
        ],
        "summary": "List unified leads (v0)",
        "description": "Channel-touchpoint aggregation of leads across calls, the scheduling widget, web chat, text, and Google LSA. This is **not** the canonical leads record and does not include the raw third-party payload — for that, use the v1 leads feed (`GET /api/v1/teams/{teamId}/leads`). Requires the `read:leads` permission.",
        "operationId": "listLeadsV0",
        "parameters": [
          {
            "$ref": "#/components/parameters/xTeamId"
          },
          {
            "$ref": "#/components/parameters/startDate7d"
          },
          {
            "$ref": "#/components/parameters/endDateNow"
          },
          {
            "name": "type",
            "in": "query",
            "description": "Filter by lead type",
            "schema": {
              "type": "string",
              "enum": [
                "call",
                "scheduling_widget",
                "web_chat",
                "text",
                "google_lsa"
              ]
            }
          },
          {
            "$ref": "#/components/parameters/limit1000"
          },
          {
            "$ref": "#/components/parameters/offset"
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of unified leads",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/LeadV0"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/OffsetPagination"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/api/teams": {
      "get": {
        "tags": [
          "Teams"
        ],
        "summary": "List teams (v0)",
        "description": "List the teams the API key can access. For multi-team keys, all accessible teams; for single-team keys, the one team. Requires the `read:teams` permission.",
        "operationId": "listTeamsV0",
        "responses": {
          "200": {
            "description": "Accessible teams",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "teams": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Team"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/api/coach": {
      "get": {
        "tags": [
          "Coach"
        ],
        "summary": "List coach call evaluations",
        "description": "List evaluated coach (QA) calls for the team, newest first. Each row includes the score, awarded/max points, per-item evaluation answers, and the `rubric_id` for joining to `GET /api/coach/rubrics`. Requires the `read:coach` permission.",
        "operationId": "listCoachCalls",
        "parameters": [
          {
            "$ref": "#/components/parameters/xTeamId"
          },
          {
            "$ref": "#/components/parameters/limit1000"
          },
          {
            "$ref": "#/components/parameters/offset"
          },
          {
            "$ref": "#/components/parameters/startDate7d"
          },
          {
            "$ref": "#/components/parameters/endDateNow"
          },
          {
            "$ref": "#/components/parameters/timezone"
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated list of coach calls",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/CoachCall"
                      }
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/OffsetPagination"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/api/coach/{id}": {
      "get": {
        "tags": [
          "Coach"
        ],
        "summary": "Get a coach call evaluation",
        "description": "Get a single evaluated coach call by its numeric ID. Requires the `read:coach` permission.",
        "operationId": "getCoachCall",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Coach call ID (number)",
            "schema": {
              "type": "integer"
            }
          },
          {
            "$ref": "#/components/parameters/xTeamId"
          }
        ],
        "responses": {
          "200": {
            "description": "The coach call",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/CoachCall"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          }
        }
      }
    },
    "/api/coach/rubrics": {
      "get": {
        "tags": [
          "Coach"
        ],
        "summary": "List coach rubrics",
        "description": "Reference endpoint: lists the team's enabled rubrics. Items provide the key → name mapping for the `evaluation_answers` keys returned on coach calls. Requires the `read:coach` permission.",
        "operationId": "listCoachRubrics",
        "parameters": [
          {
            "$ref": "#/components/parameters/xTeamId"
          }
        ],
        "responses": {
          "200": {
            "description": "Enabled rubrics with item key/name pairs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "title": {
                            "type": "string"
                          },
                          "items": {
                            "type": "array",
                            "items": {
                              "type": "object",
                              "properties": {
                                "key": {
                                  "type": "string"
                                },
                                "name": {
                                  "type": "string"
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/api/scheduler-analytics": {
      "get": {
        "tags": [
          "Scheduler Analytics (v0)"
        ],
        "summary": "Get scheduler analytics",
        "description": "Detailed Simple Scheduler analytics. Select which metric blocks to include with the `metrics` parameter: `funnel`, `bookings`, `chart`, `utm`, `google_ads`, `service_areas`, `issue_types`, `customer_events`. Requires the `read:scheduler_analytics` permission.",
        "operationId": "getSchedulerAnalytics",
        "parameters": [
          {
            "$ref": "#/components/parameters/xTeamId"
          },
          {
            "$ref": "#/components/parameters/startDate7d"
          },
          {
            "$ref": "#/components/parameters/endDateNow"
          },
          {
            "$ref": "#/components/parameters/timezone"
          },
          {
            "name": "scheduler_id",
            "in": "query",
            "description": "Filter to a specific scheduler",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "metrics",
            "in": "query",
            "description": "Comma-separated metric blocks to include (default: all)",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/limit1000"
          },
          {
            "$ref": "#/components/parameters/offset"
          }
        ],
        "responses": {
          "200": {
            "description": "Requested analytics blocks",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/SchedulerAnalytics"
                    },
                    "pagination": {
                      "$ref": "#/components/schemas/OffsetPagination"
                    },
                    "metadata": {
                      "type": "object",
                      "properties": {
                        "startDate": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "endDate": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "timezone": {
                          "type": "string"
                        },
                        "schedulerId": {
                          "type": [
                            "integer",
                            "null"
                          ]
                        },
                        "metricsRequested": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/api/scheduler-analytics/summary": {
      "get": {
        "tags": [
          "Scheduler Analytics (v0)"
        ],
        "summary": "Get scheduler analytics summary",
        "description": "Summary Simple Scheduler stats for today, this week, and this month. Requires the `read:scheduler_analytics` permission.",
        "operationId": "getSchedulerAnalyticsSummary",
        "parameters": [
          {
            "$ref": "#/components/parameters/xTeamId"
          },
          {
            "$ref": "#/components/parameters/timezone"
          }
        ],
        "responses": {
          "200": {
            "description": "Summary stats",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "today": {
                          "$ref": "#/components/schemas/PeriodSummary"
                        },
                        "thisWeek": {
                          "$ref": "#/components/schemas/PeriodSummary"
                        },
                        "thisMonth": {
                          "$ref": "#/components/schemas/PeriodSummary"
                        }
                      }
                    },
                    "metadata": {
                      "type": "object",
                      "properties": {
                        "timezone": {
                          "type": "string"
                        },
                        "generatedAt": {
                          "type": "string",
                          "format": "date-time"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/api/simple_scheduler_booking_requests": {
      "get": {
        "tags": [
          "Scheduler Analytics (v0)"
        ],
        "summary": "List Simple Scheduler booking requests",
        "description": "Booking requests submitted through Simple Scheduler. Supports offset pagination (`offset` + `limit`, returns `meta.total`) or cursor pagination (`cursor` = `created_at` from a previous page; response includes `next_cursor` and `has_more`). Requires the `read:scheduler_analytics` permission.",
        "operationId": "listSimpleSchedulerBookingRequests",
        "parameters": [
          {
            "$ref": "#/components/parameters/xTeamId"
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by request status",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "scheduler_id",
            "in": "query",
            "description": "Filter to a specific scheduler",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "has_utm",
            "in": "query",
            "description": "When `true`, only requests with UTM attribution",
            "schema": {
              "type": "boolean"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "ISO 8601 `created_at` cursor from a previous page (cursor mode)",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "$ref": "#/components/parameters/limit500"
          },
          {
            "$ref": "#/components/parameters/offset"
          }
        ],
        "responses": {
          "200": {
            "description": "Booking requests",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "team_id": {
                            "type": "integer"
                          },
                          "scheduler_id": {
                            "type": "integer"
                          },
                          "status": {
                            "type": "string"
                          },
                          "st_job_id": {
                            "type": [
                              "integer",
                              "null"
                            ],
                            "description": "ServiceTitan job ID when the request produced a job"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "request_data": {
                            "type": "object",
                            "description": "Raw booking request payload"
                          }
                        }
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": [
                            "integer",
                            "null"
                          ],
                          "description": "Total rows (offset mode only)"
                        },
                        "next_cursor": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "description": "Cursor for the next page (cursor mode)"
                        },
                        "has_more": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/api/simple_scheduler_config": {
      "get": {
        "tags": [
          "Scheduler Analytics (v0)"
        ],
        "summary": "List Simple Scheduler configs",
        "description": "Scheduler configurations for the team. Team is resolved from `x-team-id` or the optional `team_id` query parameter (multi-team keys must have access to that team). Requires the `read:scheduler_analytics` permission.",
        "operationId": "listSimpleSchedulerConfigs",
        "parameters": [
          {
            "$ref": "#/components/parameters/xTeamId"
          },
          {
            "name": "team_id",
            "in": "query",
            "description": "Target team (alternative to the x-team-id header for multi-team keys)",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Scheduler configs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SchedulerConfig"
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/api/v1/teams": {
      "get": {
        "tags": [
          "Teams"
        ],
        "summary": "List teams",
        "description": "List all teams accessible with this API key. Requires the `read:teams` permission. Internal QA/test teams are excluded by default; pass `include_test_teams=true` to include them.",
        "operationId": "listTeams",
        "parameters": [
          {
            "$ref": "#/components/parameters/includeTestTeams"
          }
        ],
        "responses": {
          "200": {
            "description": "Accessible teams",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Team"
                      }
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          }
        }
      }
    },
    "/api/v1/teams/{teamId}/schedulers": {
      "get": {
        "tags": [
          "Sessions & Bookings"
        ],
        "summary": "List schedulers",
        "description": "List scheduler configs for a team. Requires the `read:scheduler_analytics` permission.",
        "operationId": "listSchedulers",
        "parameters": [
          {
            "$ref": "#/components/parameters/teamIdPath"
          }
        ],
        "responses": {
          "200": {
            "description": "Scheduler configs",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "scheduler_id": {
                            "type": "integer"
                          },
                          "name": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "updated_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/TeamMeta"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          }
        }
      }
    },
    "/api/v1/teams/{teamId}/sessions": {
      "get": {
        "tags": [
          "Sessions & Bookings"
        ],
        "summary": "List sessions",
        "description": "List scheduling-widget sessions for a team — a customer's journey from starting a booking to completing it or dropping off. Requires the `read:scheduler_analytics` permission.",
        "operationId": "listTeamSessions",
        "parameters": [
          {
            "$ref": "#/components/parameters/teamIdPath"
          },
          {
            "name": "status",
            "in": "query",
            "description": "Filter by session status",
            "schema": {
              "type": "string",
              "enum": [
      

# --- truncated at 32 KB (95 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/avoca/refs/heads/main/openapi/avoca-openapi-original.json