Create Appointment
Create a new appointment (manual booking)
POST
/calendar/appointmentsRequires
Bearer authenticationCreate a new appointment manually. The end time is automatically calculated based on the appointment type's duration.
Request Body
appointment_type_idstringrequiredThe ID of the appointment type.
start_timestringrequiredAppointment start time (ISO 8601 format).
client_namestringrequiredClient's full name.
client_emailstringClient's email address.
client_phonestringClient's phone number.
client_languagestringClient's preferred language. Defaults to 'en'.
client_notesstringNotes from the client.
internal_notesstringInternal notes (not visible to client).
POST
/calendar/appointmentscurl -X POST "https://api.vastal.agency/v1/calendar/appointments" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "appointment_type_id": "type_def456", "start_time": "2024-01-25T14:00:00Z", "client_name": "Jane Doe", "client_email": "jane@example.com", "client_phone": "+1234567890" }'
const response = await fetch( 'https://api.vastal.agency/v1/calendar/appointments', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify({ appointment_type_id: 'type_def456', start_time: '2024-01-25T14:00:00Z', client_name: 'Jane Doe', client_email: 'jane@example.com', client_phone: '+1234567890' }) } ); const data = await response.json();
import requests response = requests.post( 'https://api.vastal.agency/v1/calendar/appointments', headers={ 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }, json={ 'appointment_type_id': 'type_def456', 'start_time': '2024-01-25T14:00:00Z', 'client_name': 'Jane Doe', 'client_email': 'jane@example.com', 'client_phone': '+1234567890' } ) data = response.json()
200Success
{ "appointment": { "id": "apt_new123", "org_id": "org_xyz789", "appointment_type_id": "type_def456", "start_time": "2024-01-25T14:00:00Z", "end_time": "2024-01-25T15:00:00Z", "client_name": "Jane Doe", "client_email": "jane@example.com", "client_phone": "+1234567890", "status": "confirmed", "confirmed_at": "2024-01-20T12:00:00Z", "source": "manual", "appointment_type": { "id": "type_def456", "name": "Tax Consultation", "duration_minutes": 60, "color": "#3b82f6" } } }
400Bad Request
{ "error": "appointment_type_id, start_time, and client_name are required" }