Skip to main content

API and Integration Methods

This page is a recommended specification for the API your team exposes to Avoca — not documentation of existing Avoca endpoints. Production custom integrations today use the two-step payload handshake pattern; a standard REST design like the one below is equally supported for new integrations. Endpoint paths, field names, and shapes are adapted to your system during the integration process.
Availability Management
Purpose: Query available appointment slots
Required parameters:
  • service_type (string)
  • location_id (string)
  • date_range_start (ISO 8601 datetime)
  • date_range_end (ISO 8601 datetime)
  • provider_id (string, optional)
  • duration_minutes (integer, optional)
Sample request:
Expected response:
Booking Creation
Purpose: Create new appointment booking
Required fields:
  • slot_id (string)
  • customer (object) – name, email, phone, and optional address
  • service_type (string)
  • notes (string, optional)
  • notification_preferences (object, optional)
Sample request:
Expected response:
Booking Modifications
Cancellation payload fields:
  • reason (string, optional)
  • cancellation_type (string: customer_initiated, provider_initiated)
Customer Management
Service Catalog
Pricing Queries
Purpose: Calculate pricing for a specific service configuration
Required fields:
  • service_type (string)
  • location_id (string)
  • modifiers (array, optional) – add-ons, special requirements

Integration Protocols & Standards

Primary Protocol: RESTful APIs
  • Format: JSON (UTF-8 encoding)
  • Versioning: URL-based (e.g., /api/v1/)
  • HTTP methods: Full REST semantics (GET, POST, PATCH, PUT, DELETE)
  • Status codes: Standard HTTP status codes with detailed error responses
Webhook Support (Strongly Recommended) – Avoca consumes webhooks for real-time event notifications. Webhook events we should receive:
Webhook payload format:
Webhook requirements:
  • Endpoint: We provide a unique webhook endpoint URL per integration
  • Security: HMAC signature verification (preferred) or secret token in header
  • Delivery: At-least-once delivery with retry logic
  • Response: 200 OK within 5 seconds
  • Idempotency: Duplicate webhook deliveries handled via event_id
GraphQL (Optional) – We can support GraphQL if preferred. It reduces over-fetching, is useful for nested queries, and can coexist with REST endpoints.

Authentication Methods

Preferred: OAuth 2.0 Client Credentials Flow Implementation details:
  • Grant type: client_credentials
  • Token endpoint: /oauth/token
  • Token format: JWT (preferred) or opaque tokens
  • Token expiration: 1 hour recommended
  • Refresh strategy: Automatic refresh before expiration
  • Scopes: Role-based (e.g., bookings:read, bookings:write, customers:read)
Request:
Response:
Alternative: API Keys – If OAuth is not feasible:
  • API keys transmitted via Authorization: Bearer {api_key}
  • Separate keys for production and sandbox
  • Key rotation with grace period
  • Rate limiting and monitoring per API key
JWT Tokens – If using JWT directly:
  • Algorithm: RS256 or ES256 (asymmetric preferred)
  • Claims: Include iss, aud, exp, sub
  • Key management: Public key endpoint for signature verification
Security Requirements
  • Credentials stored in encrypted secrets management (1Password, AWS Secrets Manager)
  • Credentials never logged or exposed in errors
  • Automatic credential rotation supported
  • Per-environment credentials (development, staging, production)

API Design Preferences

Data Formats
  • Primary: JSON with UTF-8 encoding
  • Date/time: ISO 8601 (e.g., 2025-10-31T14:30:00Z)
  • Decimal numbers: String representation for currency to avoid floating-point drift
Versioning Strategy
  • URL-based versioning (e.g., /api/v1/)
  • Maintain at least one previous major version for backward compatibility
  • Deprecation notices: Minimum 90-day notice with Sunset HTTP header
  • Version negotiation: Current version advertised in response headers
Rate Limiting
  • Recommended thresholds:
    • Standard operations: 1000 requests/minute per API key
    • Availability queries: 300 requests/minute
    • Bulk operations: 100 requests/minute
  • Rate limit headers:
  • 429 responses should include clear retry-after guidance
  • Allow reasonable burst capacity (e.g., 2× sustained rate for 10 seconds)
Pagination
Sample response:
Error Response Format