Saltar al contenido principal

Create Appointment

This endpoint allows you to create a new appointment in the system. The appointment can be associated with one or more calendars and an optional service. You can also provide guests and reminders.

🔹 Endpoint Details

POST /api/v2/appointments

🔒 Authentication

HeaderRequiredDescription
Content-TypeYesMust be application/json
AuthorizationYesFormat: ONLIVESITE Credential:ONLIVEAccessKeyId, Signature=CalculatedSignature

📝 Request Structure

Required Fields

Conditional requirements apply:

  • If blockedAppointmentId is NOT provided, startAt, endAt must be valid ISO 8601 datetimes.
FieldTypeRequiredDescriptionExample
startAtstring (ISO 8601)Cond.Start time"2025-05-20T14:00:00Z"
endAtstring (ISO 8601)Cond.End time"2025-05-20T15:00:00Z"

Optional Fields

FieldTypeRequiredDescriptionExample
titlestringNoAppointment title"Quarterly Review Meeting"
descriptionstringNoDetailed description-
langstringNoLanguage code (BCP 47)"en-US"
statusstringNoAppointment status"confirmed"
subStatusstringNoAppointment sub-status"pending"
originstringNoSource/platform"web-portal"
originUrlstring (URL)NoOrigin URL"https://example.com/create"
commentstringNoComment or note"Special requirements"
interactionIdstringNoInteraction identifier"123e4567-e89b-12d3-a456-426614174000"
externalIdstringNoExternal identifier"EXT-APT-123"
remindersarray of objectNoReminder settingsSee reminders schema below
guestsarray of objectNoGuest listSee guests schema below
calendarIdsarray of string (UUID)Cond.Calendar identifiers (required unless blocking by reference)["123e4567-e89b-12d3-a456-426614174000"]
serviceIdstring (UUID)NoAssociated service"01392598-e4b2-4810-ac7c-8c9cf4286a26"
userGroupIdstring (UUID)NoAssociated user group"123e4567-e89b-12d3-a456-426614174000"
blockedbooleanNoWhether the appointment is a blockfalse
blockedAppointmentIdstring (UUID)NoBlock existing appointment by reference"123e4567-e89b-12d3-a456-426614174000"
extraFieldsobjectNoAdditional custom fields{ "priority": "high" }

Reminders schema

FieldTypeRequiredDescriptionExample
timenumberYesNumeric value for reminder time10
unitenumYesTime unit. One of: s, m, h"m"
directionenumYesDirection relative to appointment time. before or after"before"

Guest schema

FieldTypeRequiredDescriptionExample
emailstringNoGuest email"[email protected]"
phonestringNoGuest phone"+1234567890"
firstNamestringNoGuest first name"John"
lastNamestringNoGuest last name"Doe"
statusstringNoGuest status"invited"
canonicalIdstringNoCanonical ID"guest-12345"

🧩 Request Examples

Basic Appointment

curl -X POST "https://openapi.onlive.site/api/v2/appointments" \
-H "Content-Type: application/json" \
-H "Authorization: ONLIVESITE Credential:ONLIVEAccessKeyId, Signature=CalculatedSignature" \
-d '{
"title": "Quick Meeting",
"startAt": "2025-05-20T14:00:00Z",
"endAt": "2025-05-20T15:00:00Z",
"calendarIds": [
"af6c6be0-689a-4cf3-a8c8-550dd97b3a6b"
]
}'

Comprehensive Appointment

curl -X POST "https://openapi.onlive.site/api/v2/appointments" \
-H "Content-Type: application/json" \
-H "Authorization: ONLIVESITE Credential:ONLIVEAccessKeyId, Signature=CalculatedSignature" \
-d '{
"title": "Product Demo Meeting",
"description": "Product demonstration with new features",
"startAt": "2025-05-20T14:00:00Z",
"endAt": "2025-05-20T15:00:00Z",
"calendarIds": [
"af6c6be0-689a-4cf3-a8c8-550dd97b3a6b"
],
"serviceId": "01392598-e4b2-4810-ac7c-8c9cf4286a26",
"lang": "en-US",
"reminders": [
{
"time": 10,
"unit": "m",
"direction": "before"
}
],
"guests": [
{
"email": "[email protected]"
}
],
"extraFields": {
"priority": "high",
"location": "Conference Room A"
}
}'

📤 Response Format

Success Response (201 Created)

{
"id": "1610c525-f19a-40d0-8cd1-03daba3d2d98",
"createdAt": "2025-05-20T13:55:03.735Z",
"updatedAt": "2025-05-20T13:55:03.735Z",
"title": "Product Demo Meeting",
"description": "Product demonstration with new features",
"lang": "en-US",
"startAt": "2025-05-20T14:00:00Z",
"endAt": "2025-05-20T15:00:00Z",
"calendarIds": ["af6c6be0-689a-4cf3-a8c8-550dd97b3a6b"],
"serviceId": "01392598-e4b2-4810-ac7c-8c9cf4286a26",
"reminders": [
{
"time": 10,
"unit": "m",
"direction": "before"
}
],
"guests": [
{
"email": "[email protected]"
}
],
"extraFields": {
"priority": "high",
"location": "Conference Room A"
},
"status": "confirmed",
"origin": "web-portal"
}

❌ Error Responses

This endpoint follows the standard error format.

📘 Notes

  • The organizationId is automatically set from your authentication credentials
  • All times must be in ISO 8601 format with UTC timezone
  • Guest email notifications are handled automatically based on preferences
  • Service constraints (duration, availability) are automatically validated
  • Default reminder is 10 minutes before appointment if not specified
  • Calendar availability is checked before appointment creation
  • To create a block, set blocked: true and provide startAt/endAt or use blockedAppointmentId to reference an existing appointment.

✅ Common Use Cases

  • 📅 Basic Meeting: Schedule simple one-on-one meetings
  • 👥 Team Event: Create meetings with multiple participants
  • 🎯 Service Booking: Schedule service-based appointments
  • 🌐 Virtual Meeting: Set up video conferences
  • 📊 Resource Booking: Schedule equipment or room usage

🔍 Validation Rules

  1. Time Validation

    • End time must be after start time
    • Times must be in the future
    • Duration must match service requirements (if applicable)
  2. Guest Validation

    • Valid email addresses or phone numbers can be provided
    • Maximum 50 guests per appointment
    • Duplicate emails not allowed
  3. Calendar Validation

    • Calendar must be available
    • Time slot must be free (unless specific business logic allows overlaps)
    • Must be within calendar's working hours
  4. Service Validation

    • Service must be active
    • Duration must match service settings
    • Must respect service scheduling rules

💡 Best Practices

  1. Scheduling

    • Check calendar availability first
    • Consider timezone differences
    • Allow buffer time between appointments
  2. Guest Management

    • Validate email addresses
    • Set appropriate notification preferences
    • Consider guest calendar availability
  3. Service Integration

    • Use service templates when possible
    • Respect service duration requirements
    • Include relevant service details