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.
Recommended API Endpoints
Availability ManagementRequired 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)
Required fields:
slot_id(string)customer(object) –name,email,phone, and optionaladdressservice_type(string)notes(string, optional)notification_preferences(object, optional)
reason(string, optional)cancellation_type(string:customer_initiated,provider_initiated)
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
- 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
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)
- 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
- Algorithm: RS256 or ES256 (asymmetric preferred)
- Claims: Include
iss,aud,exp,sub - Key management: Public key endpoint for signature verification
- 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
- URL-based versioning (e.g.,
/api/v1/) - Maintain at least one previous major version for backward compatibility
- Deprecation notices: Minimum 90-day notice with
SunsetHTTP header - Version negotiation: Current version advertised in response headers
- 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)