Create Appointment Type
Create a new appointment type
/calendar/appointment-typesBearer authenticationCreate a new appointment type for your organization. Appointment types define the services clients can book.
Request Body
namestringrequiredName of the appointment type (e.g., 'Tax Consultation').
durationMinutesintegerrequiredDuration in minutes.
descriptionstringDescription shown on booking page.
colorstringColor for calendar display (hex code). Defaults to #3b82f6.
bufferBeforeMinutesintegerBuffer time before appointments.
bufferAfterMinutesintegerBuffer time after appointments.
maxPerDayintegerMaximum appointments of this type per day.
maxPerWeekintegerMaximum appointments of this type per week.
maxPerMonthintegerMaximum appointments of this type per month.
minNoticeHoursintegerMinimum hours notice required. Defaults to 24.
maxDaysAheadintegerHow far ahead clients can book. Defaults to 60 days.
requiresConfirmationbooleanWhether appointments require manual confirmation. Defaults to false.
confirmWithinHoursintegerHours to confirm before auto-cancellation.
bookingQuestionsarrayCustom questions to ask during booking.
scheduleIdstringID of named schedule to use for availability.
isActivebooleanWhether this type is bookable. Defaults to true.
/calendar/appointment-typescurl -X POST "https://api.vastal.agency/v1/calendar/appointment-types" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Strategy Call", "durationMinutes": 30, "description": "Quick 30-minute strategy session", "color": "#10b981", "minNoticeHours": 48, "maxPerDay": 4, "bookingQuestions": [ { "id": "q1", "type": "textarea", "label": "What would you like to discuss?", "required": true } ] }'
const response = await fetch( 'https://api.vastal.agency/v1/calendar/appointment-types', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify({ name: 'Strategy Call', durationMinutes: 30, description: 'Quick 30-minute strategy session', color: '#10b981', minNoticeHours: 48, maxPerDay: 4, bookingQuestions: [ { id: 'q1', type: 'textarea', label: 'What would you like to discuss?', required: true } ] }) } ); const data = await response.json();
import requests response = requests.post( 'https://api.vastal.agency/v1/calendar/appointment-types', headers={ 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }, json={ 'name': 'Strategy Call', 'durationMinutes': 30, 'description': 'Quick 30-minute strategy session', 'color': '#10b981', 'minNoticeHours': 48, 'maxPerDay': 4, 'bookingQuestions': [ { 'id': 'q1', 'type': 'textarea', 'label': 'What would you like to discuss?', 'required': True } ] } ) data = response.json()
{ "appointmentType": { "id": "type_new123", "orgId": "org_xyz789", "name": "Strategy Call", "description": "Quick 30-minute strategy session", "durationMinutes": 30, "color": "#10b981", "minNoticeHours": 48, "maxDaysAhead": 60, "maxPerDay": 4, "requiresConfirmation": false, "bookingQuestions": [ { "id": "q1", "type": "textarea", "label": "What would you like to discuss?", "required": true } ], "isActive": true, "sortOrder": 2, "createdAt": "2024-01-20T12:00:00Z" } }