Free setup on annual plans

Sign up today!

Appointments and calendar

Appointments and calendar

API Reference: Appointments and calendar endpoints

Appointments are booked on a representative’s time for an end user, usually from a ticket: a phone call, a visit on site or an online Teams meeting. You ask for free times, hold one, and confirm it; AnswerPal then writes the appointment to the representative’s Microsoft 365 calendar (when it is linked) and informs the end user. These endpoints also manage appointment types and their notification texts, bookable hours, the calendar link status, and the answer to meeting invitations received in a ticket.

Overview

  • Booking flow
    GET /api/Appointments/availability gives the free start times, POST /api/Appointments/hold reserves one for a few minutes, POST /api/Appointments/{id}/confirm books it. After that the appointment can be rescheduled, reassigned to another representative or cancelled.
  • Who
    Every role except Analyst can book and follow appointments on the tickets it may open. Appointment types and their notification texts are for an Administrator. A representative manages their own bookable hours; an Administrator manages those of everyone.
  • Times
    Fields ending in Utc are UTC with a Z. Fields ending in Local are the representative’s wall-clock time without offset. Input with an offset is converted to UTC; input without one is read as UTC. Bookable hours are in the representative’s time zone (a Windows time zone ID such as Romance Standard Time).
  • Calendar
    Busy times and events use the representative’s linked Microsoft 365 calendar. Without a linked calendar, availability only uses the bookable hours and AnswerPal’s own bookings, and no events are written.

Endpoints

Appointments

  • GET /api/Appointments/availability
    Access: Bearer JWT (all roles except Analyst)
    Free start times per representative for one appointment type in a period, and the representative AnswerPal would choose. Query: appointmentTypeId, from and to (required, at most 62 days apart), and optionally ticketId, topicId, customerRepId, appointmentId, endUserId, locationAddress, shownFrom, shownTo.
  • POST /api/Appointments/hold
    Access: Bearer JWT (all roles except Analyst)
    Reserve a free time at one representative. Answers 201 Created with the appointment in status Held.
  • POST /api/Appointments/{id}/confirm
    Access: Bearer JWT (all roles except Analyst)
    Book a held appointment. Returns the appointment, normally Confirmed.
  • POST /api/Appointments/{id}/release
    Access: Bearer JWT (all roles except Analyst)
    Give an unconfirmed hold back. Returns the appointment, Cancelled with reason Hold released.
  • POST /api/Appointments/{id}/reschedule
    Access: Bearer JWT (all roles except Analyst)
    Move a confirmed appointment to another start time at the same representative.
  • POST /api/Appointments/{id}/reassign
    Access: Bearer JWT (all roles except Analyst)
    Give a confirmed appointment to another representative of the type, optionally at another time.
  • POST /api/Appointments/{id}/cancel
    Access: Bearer JWT (all roles except Analyst)
    Cancel an appointment. A hold is released instead.
  • GET /api/Appointments/{id}
    Access: Bearer JWT (all roles except Analyst)
    One appointment with its calendar events.
  • GET /api/Appointments
    Access: Bearer JWT (all roles except Analyst)
    The appointments of a ticket, by start time. Query: ticketId (required). Holds that were never confirmed are left out.
  • GET /api/Appointments/types
    Access: Bearer JWT (all roles except Analyst)
    The appointment types that can be booked, with their representatives. Query: appointmentTypeId (optional: that one type, also when inactive).
  • GET /api/Appointments/needs-reassignment
    Access: Bearer JWT (all roles except Analyst)
    Upcoming confirmed appointments whose representative is inactive or no longer in the type’s pool. Administrator only; other roles get 403.

Appointment requests

  • GET /api/Appointments/requests
    Access: Bearer JWT (all roles except Analyst)
    The appointment requests of a ticket, newest first. Query: ticketId (required).
  • POST /api/Appointments/requests
    Access: Bearer JWT (all roles except Analyst)
    Record that the end user of a ticket wants an appointment that is booked later. Answers 201 Created with the request.
  • POST /api/Appointments/requests/{id}/dismiss
    Access: Bearer JWT (all roles except Analyst)
    Close an open request without booking. Returns the request, status Dismissed.

Appointment types

  • GET /api/AppointmentTypes
    Access: Bearer JWT (Administrator)
    All appointment types, also inactive ones, by sortOrder and name.
  • POST /api/AppointmentTypes
    Access: Bearer JWT (Administrator)
    Create an appointment type, with default notification texts. Answers 201 Created with the type.
  • GET /api/AppointmentTypes/{id}
    Access: Bearer JWT (Administrator)
    One appointment type with its pool of representatives.
  • PUT /api/AppointmentTypes/{id}
    Access: Bearer JWT (Administrator)
    Replace an appointment type. Returns the type.
  • DELETE /api/AppointmentTypes/{id}
    Access: Bearer JWT (Administrator)
    Delete an appointment type that has no appointments or requests. Answers 204 No Content.

Notification texts

  • GET /api/AppointmentTypes/{appointmentTypeId}/notification-templates
    Access: Bearer JWT (Administrator)
    The notification texts of an appointment type.
  • PUT /api/AppointmentTypes/{appointmentTypeId}/notification-templates
    Access: Bearer JWT (Administrator)
    Replace all notification texts of an appointment type. Returns the new set.
  • POST /api/AppointmentTypes/{appointmentTypeId}/notification-templates/defaults
    Access: Bearer JWT (Administrator)
    Replace the texts with the default set (Dutch, French and English). Returns the new set.

Notifications of an appointment

  • GET /api/Appointments/{appointmentId}/notifications
    Access: Bearer JWT (all roles except Analyst)
    The messages planned or sent to the end user for one appointment, by due time.

Bookable hours and calendar

  • GET /api/CustomerReps/{customerRepId}/bookable-hours
    Access: Bearer JWT
    The general bookable hours of a representative and, per appointment type in their pool, the hours that apply. An Administrator may read anyone; other users only their own ID (else 403).
  • PUT /api/CustomerReps/{customerRepId}/bookable-hours
    Access: Bearer JWT
    Replace the bookable hours of a representative. Same access rule as reading.
  • GET /api/CustomerReps/{customerRepId}/outlook-working-hours
    Access: Bearer JWT
    A proposal of bookable hours from the working hours in the representative’s Outlook. Nothing is stored. Same access rule.
  • GET /api/CustomerReps/{customerRepId}/calendar-status
    Access: Bearer JWT
    The state of the representative’s calendar link. Same access rule.
  • GET /api/CustomerReps/{customerRepId}/agenda
    Access: Bearer JWT
    A representative’s bookable hours, busy times and appointments in a period. Query: from and to (required, at most 31 days apart) and appointmentTypeId. Administrator only; other users get 403.

Ticket contacts

  • GET /api/Tickets/{id}/appointment-contacts
    Access: Bearer JWT (all roles except Analyst)
    The end users that match the sender of a ticket, so a booking can name the right one.

Meeting invitations

  • GET /api/ticketmessages/{id}/meeting
    Access: Bearer JWT (all roles except Analyst)
    The Microsoft 365 meeting invitation (or cancellation) in a ticket message, with its live state in the channel mailbox’s calendar.
  • POST /api/ticketmessages/{id}/meeting/respond
    Access: Bearer JWT (all roles except Analyst)
    Accept, tentatively accept or decline the invitation from the channel mailbox.

Booking an appointment

Availability

  • Query
    appointmentTypeId (required); from, to (required; to after from, at most 62 days); ticketId (brings the ticket’s representative and detected topics into the choice); topicId (instead of the ticket’s topics); customerRepId (only this representative; must be in the type’s pool); appointmentId (free times for moving that appointment, with its own duration); endUserId and locationAddress (on-site types at the end user’s address); shownFrom, shownTo (dates yyyy-MM-dd, both or neither).
  • Answer
    appointmentTypeID, appointmentTypeName, kind, durationMinutes, prepMinutes, postMinutes; fromUtc, toUtc (the part of the period that can be booked, after lead time and horizon); ticketID, ticketCustomerRepID, topicIDs; reps; cascade; warnings; location (on-site types: mode, address, problem); travelTimeEnabled.
  • reps
    Per representative: customerRepID, name, timeZone, calendarEnabled, inPool, unavailableReason (OutsidePool, NotBookable, CalendarError, NoLinkedCalendar, Inactive, OutsideWindow, NoAddress or TravelUnavailable), calendarError, confirmedAppointmentsNext14Days, slots (startUtc, endUtc, startLocal, endLocal and travel minutes) and travelProblem.
  • cascade
    Which representative AnswerPal picks: chosenCustomerRepID and step (TicketRep: the ticket’s representative, TopicRep, Pool, Explicit or None), preferredRepMaxWaitDays and the candidates with their reason.
  • Slots
    Start times follow the type’s grid inside the representative’s bookable hours; preparation and follow-up time must fit in the same block. Busy time in the linked calendar and other AnswerPal bookings of the representative block a slot. A calendar that cannot be read gives that representative no slots.
  • Travel time
    travelTimeEnabled tells whether travel time between on-site appointments is taken into account. When it is false, slots ignore travel, the travel minutes are 0 and on-site types add a warning. An on-site type at the end user’s address still needs a complete address (a street plus a postal code or city).

Hold and confirm

Hold (body)

  • appointmentTypeID (integer, required)
    An active type of the account.
  • customerRepID (integer, required)
    An active representative in the type’s pool; for an online type with a linked calendar.
  • startUtc (date-time, required)
    A start time that availability would offer, not in the past.
  • ticketID (integer)
  • endUserID (integer)
    Without it the end user is found from the ticket’s sender or contactPhone: one match is used, several give 400 (pass endUserID), none creates a new end user with newEndUserName.
  • newEndUserName (string)
    Name for a new end user: the first word becomes the first name.
  • contactPhone (string)
    Stored in international format (max 50).
  • proposeOnly (boolean)
    Keep the hold for the type’s proposeOnlyHoldMinutes instead of 5 minutes, for example while the end user decides.
  • appointmentRequestID (integer)
    An open request of the same ticket and type; it becomes Booked.
  • locationAddress (string, max 400)
    On-site types at the end user’s address: the visit address, when it differs from the end user’s.

A hold lasts 5 minutes (or the propose-only time), never past the start. It informs nobody and writes nothing to the calendar. An expired hold becomes Cancelled with reason Hold expired. confirm, release and cancel take no body.

Appointment (response)

  • appointmentID, appointmentTypeID, customerRepID, endUserID, ticketID
  • startUtc, endUtc (without buffers), prepMinutes, postMinutes
  • status, operation (Confirm, Reschedule, Reassign or Cancel while it runs), targetStartUtc, targetEndUtc, targetCustomerRepID, scheduleVersion (raised by every move), statusChangedUtc
  • holdExpiresUtc, holdSecondsLeft
  • contactPhone, direction (phone types: RepCalls or EndUserCalls), onlineMeetingUrl (online types, after confirm), locationAddress
  • createdByCustomerRepID, createdBySource (Rep or Ai), cancelledReason, warning
  • travelToMinutes, travelFromMinutes, travelToEstimated, travelFromEstimated, travelFromDestination, travelNote
  • appointmentTypeName, appointmentTypeKind, customerRepName, customerRepTimeZone, targetCustomerRepName, endUserName
  • events
    The calendar events: role (Prep, Main, Post, TravelTo, TravelFrom), mailbox, state, appliedStartUtc, appliedEndUtc, attemptCount and related fields.
GET /api/Appointments/availability?appointmentTypeId=12&from=2026-12-07T00:00:00Z&to=2026-12-12T00:00:00Z&ticketId=48213
Authorization: Bearer <token>

200 OK
{
  "appointmentTypeID": 12,
  "appointmentTypeName": "Intake call",
  "kind": "Phone",
  "durationMinutes": 30,
  "prepMinutes": 5,
  "postMinutes": 10,
  "fromUtc": "2026-12-07T00:00:00Z",
  "toUtc": "2026-12-12T00:00:00Z",
  "ticketID": 48213,
  "ticketCustomerRepID": 7,
  "topicIDs": [31],
  "reps": [
    {
      "customerRepID": 7, "name": "Sam Peeters", "timeZone": "Romance Standard Time",
      "calendarEnabled": true, "inPool": true, "unavailableReason": null, "calendarError": null,
      "confirmedAppointmentsNext14Days": 3,
      "slots": [
        { "startUtc": "2026-12-08T09:00:00Z", "endUtc": "2026-12-08T09:30:00Z", "startLocal": "2026-12-08T10:00:00", "endLocal": "2026-12-08T10:30:00", "travelBeforeMinutes": 0, "travelAfterMinutes": 0, "travelEstimated": false }
      ],
      "travelProblem": null
    }
  ],
  "cascade": { "chosenCustomerRepID": 7, "step": "TicketRep", "preferredRepMaxWaitDays": null, "candidates": [ { "customerRepID": 7, "step": "TicketRep", "chosen": true, "reason": null } ] },
  "warnings": [],
  "location": null,
  "travelTimeEnabled": false
}
POST /api/Appointments/hold
Authorization: Bearer <token>
Content-Type: application/json

{
  "appointmentTypeID": 12,
  "customerRepID": 7,
  "startUtc": "2026-12-08T09:00:00Z",
  "ticketID": 48213,
  "endUserID": 9051,
  "contactPhone": "+32 470 00 00 00"
}

201 Created
Location: /api/Appointments/5120

{
  "appointmentID": 5120,
  "appointmentTypeID": 12,
  "customerRepID": 7,
  "endUserID": 9051,
  "ticketID": 48213,
  "startUtc": "2026-12-08T09:00:00Z",
  "endUtc": "2026-12-08T09:30:00Z",
  "prepMinutes": 5,
  "postMinutes": 10,
  "status": "Held",
  "operation": null,
  "scheduleVersion": 1,
  "statusChangedUtc": "2026-12-01T10:14:07Z",
  "holdExpiresUtc": "2026-12-01T10:19:07Z",
  "holdSecondsLeft": 300,
  "contactPhone": "+32470000000",
  "direction": "RepCalls",
  "onlineMeetingUrl": null,
  "createdByCustomerRepID": 7,
  "createdBySource": "Rep",
  "travelToMinutes": 0,
  "travelFromMinutes": 0,
  "events": [],
  "appointmentTypeName": "Intake call",
  "appointmentTypeKind": "Phone",
  "customerRepName": "Sam Peeters",
  "customerRepTimeZone": "Romance Standard Time",
  "endUserName": "Lena Janssens",
  ...
}
POST /api/Appointments/5120/confirm
Authorization: Bearer <token>

200 OK
{
  "appointmentID": 5120,
  "status": "Confirmed",
  "holdExpiresUtc": null,
  "holdSecondsLeft": null,
  "events": [
    { "appointmentEventID": 880, "role": "Prep", "mailbox": "sam.peeters@example.com", "state": "Created", "appliedStartUtc": "2026-12-08T08:55:00Z", "appliedEndUtc": "2026-12-08T09:00:00Z", "attemptCount": 1, ... },
    { "appointmentEventID": 881, "role": "Main", "state": "Created", "appliedStartUtc": "2026-12-08T09:00:00Z", "appliedEndUtc": "2026-12-08T09:30:00Z", ... },
    { "appointmentEventID": 882, "role": "Post", "state": "Created", "appliedStartUtc": "2026-12-08T09:30:00Z", "appliedEndUtc": "2026-12-08T09:40:00Z", ... }
  ],
  ...
}
POST /api/Appointments/5120/reschedule
{ "startUtc": "2026-12-09T13:00:00Z" }

POST /api/Appointments/5120/reassign
{ "customerRepID": 9 }

POST /api/Appointments/5120/cancel
{ "reason": "The customer cancelled by phone" }

409 Conflict
{
  "error": "The appointment is Rescheduling with a running Reschedule operation; only cancel may interrupt it.",
  "status": "Rescheduling",
  "operation": "Reschedule"
}

Status and changes

  • Status
    Held, Confirming, Confirmed, Rescheduling, Reassigning, Cancelling, Cancelled, Failed. The statuses ending in -ing show a calendar change that is still running; the answer can return one of them and AnswerPal finishes the change in the background. Read the appointment again later.
  • Confirm
    Only a Held appointment whose hold has not expired and whose start has not passed.
  • Reschedule (body)
    startUtc (required). The duration and buffers stay as booked.
  • Reassign (body)
    customerRepID (required): another active representative of the type’s pool; startUtc (optional, default the current start).
  • Cancel (body, optional)
    reason (max 512; default Cancelled by the rep). A hold with nothing in the calendar is released without notice. Cancel is the only change that may interrupt a running one.
  • Reschedule, reassign and cancel are refused once the appointment has ended. A second change while one runs, or the same change twice, answers 409 with error, status and operation.
  • Calendar
    On confirm, AnswerPal creates a busy event for the appointment in the representative’s linked Microsoft 365 calendar, plus events for preparation and follow-up time when the type has them. Online types get a Teams meeting; its link becomes onlineMeetingUrl. A move updates the events, a reassign moves them to the other representative, a cancel removes them. When the representative deletes the event in Outlook, the appointment is cancelled.

Appointment requests

A request records on a ticket that an appointment is wanted, for when it cannot be booked right away, for example when the AI cannot tell which end user is calling. Statuses: Open, Booked (a hold named it) and Dismissed. When that hold is released or expires, the request is Open again.

Request (body)

  • ticketID, appointmentTypeID (integer, required)
  • requestedStartUtc, requestedEndUtc (date-time, both or neither)
    The wished interval; the end must lie after the start.
  • givenName (max 200), givenPhone (max 50)
    What the end user said.
  • candidateEndUserIDs (array, at most 50)
    End users of the account that may be meant.
  • notes (max 1,024)

The response adds appointmentRequestID, status, appointmentID, createdUtc, createdBySource, createdByCustomerRepID, resolvedUtc and resolvedByCustomerRepID. Recording a request also writes a line in the ticket’s timeline.

POST /api/Appointments/requests
Authorization: Bearer <token>
Content-Type: application/json

{
  "ticketID": 48213,
  "appointmentTypeID": 12,
  "requestedStartUtc": "2026-12-10T08:00:00Z",
  "requestedEndUtc": "2026-12-10T10:00:00Z",
  "givenName": "Lena Janssens",
  "givenPhone": "+32 470 00 00 00",
  "candidateEndUserIDs": [9051, 9077],
  "notes": "Prefers mornings"
}
201 Created
Location: /api/Appointments/requests?ticketId=48213

{
  "appointmentRequestID": 301,
  "ticketID": 48213,
  "appointmentTypeID": 12,
  "requestedStartUtc": "2026-12-10T08:00:00Z",
  "requestedEndUtc": "2026-12-10T10:00:00Z",
  "givenName": "Lena Janssens",
  "givenPhone": "+32 470 00 00 00",
  "candidateEndUserIDs": [9051, 9077],
  "notes": "Prefers mornings",
  "status": "Open",
  "appointmentID": null,
  "createdUtc": "2026-12-01T10:20:00Z",
  "createdBySource": "Rep",
  "createdByCustomerRepID": 7,
  "resolvedUtc": null,
  "resolvedByCustomerRepID": null
}

Appointment types

Appointment type (body)

  • name (string, required, max 100)
    Unique within the account.
  • kind (required)
    Phone (a call), OnSite (a visit) or Online (a Teams meeting through the representative’s linked calendar).
  • direction
    Phone types only: RepCalls (default) or EndUserCalls.
  • locationMode, locationAddress
    On-site types only: AtEndUser (default, the end user’s address) or AtCustomerAddress with a complete locationAddress (max 400).
  • durationMinutes (above 0), prepMinutes, postMinutes (0 or more)
    The appointment and the preparation and follow-up time around it.
  • slotGranularityMinutes (default 15)
    The grid of start times; it must divide the duration.
  • minLeadMinutes, minDaysAhead, horizonDays (default 30)
    How soon and how far ahead an appointment can be booked.
  • preferredRepMaxWaitDays (integer or null)
    How many days the preferred representative may be later than another before someone else is chosen.
  • proposeOnlyHoldMinutes (default 15), isActive (default true), sortOrder, whatsAppAllowed (notifications may use WhatsApp)
  • repPool (required, at least one)
    [{ "customerRepID": 7, "useOwnHours": false }]: active representatives; for online types each needs a linked calendar. useOwnHours gives the representative separate hours for this type.

A PUT replaces the type; omitted fields take the defaults above. Removing a representative from the pool, or setting useOwnHours to false, removes their own hours for this type. The response adds appointmentTypeID and, per pool member, name and calendarEnabled. A type with appointments or requests cannot be deleted (409); set isActive to false instead.

POST /api/AppointmentTypes
Authorization: Bearer <token>
Content-Type: application/json

{
  "name": "Home visit",
  "kind": "OnSite",
  "locationMode": "AtEndUser",
  "durationMinutes": 60,
  "prepMinutes": 0,
  "postMinutes": 15,
  "minLeadMinutes": 120,
  "minDaysAhead": 1,
  "horizonDays": 30,
  "preferredRepMaxWaitDays": 7,
  "slotGranularityMinutes": 30,
  "proposeOnlyHoldMinutes": 15,
  "isActive": true,
  "sortOrder": 2,
  "whatsAppAllowed": false,
  "repPool": [
    { "customerRepID": 7, "useOwnHours": false },
    { "customerRepID": 9, "useOwnHours": true }
  ]
}
201 Created
Location: /api/AppointmentTypes/14

{
  "appointmentTypeID": 14,
  "name": "Home visit",
  "kind": "OnSite",
  "direction": null,
  "locationMode": "AtEndUser",
  "locationAddress": null,
  "durationMinutes": 60,
  "prepMinutes": 0,
  "postMinutes": 15,
  "slotGranularityMinutes": 30,
  "horizonDays": 30,
  "isActive": true,
  "repPool": [
    { "customerRepID": 9, "name": "Ann Maes", "useOwnHours": true, "calendarEnabled": true },
    { "customerRepID": 7, "name": "Sam Peeters", "useOwnHours": false, "calendarEnabled": true }
  ],
  ...
}
GET /api/Appointments/types
Authorization: Bearer <token>

200 OK
[
  {
    "appointmentTypeID": 12,
    "name": "Intake call",
    "kind": "Phone",
    "direction": "RepCalls",
    "durationMinutes": 30,
    "prepMinutes": 5,
    "postMinutes": 10,
    "horizonDays": 30,
    "sortOrder": 1,
    "proposeOnlyHoldMinutes": 15,
    "locationMode": null,
    "locationAddress": null,
    "isActive": true,
    "reps": [ { "customerRepID": 7, "name": "Sam Peeters", "timeZone": "Romance Standard Time" } ]
  }
]

Notifications to the end user

Notification text

  • kind (required)
    Confirmation, Reminder, Changed or Cancelled.
  • channel (required)
    Email, Sms or WhatsApp.
  • language (required)
    A language code, stored as two letters.
  • reminderOffsetMinutes
    Reminders only, required: minutes before the start (for example 1440 for a day).
  • subject (max 500)
    Required for e-mail; not used for SMS and WhatsApp.
  • body (required)
    Plain text with placeholders.
  • isActive (default true); the response adds appointmentNotificationTemplateID and updatedUtc.

PUT takes { "templates": [ ... ] } and replaces the whole set; an empty list removes every text. One text per kind, channel, language and reminder offset. Validation errors answer 400 with { "message": "..." }. The default set has Dutch, French and English texts for every kind and channel, with one reminder a day before.

Placeholders

{{Appointment.Date}} (written out in the text’s language), {{Appointment.Time}} (HH:mm - HH:mm), {{Appointment.TimeZone}}, {{Appointment.Start}}, {{Appointment.End}}, {{Appointment.TypeName}}, {{Appointment.Kind}}, {{Appointment.Direction}}, {{Appointment.RepName}}, {{Appointment.RepPhone}}, {{Appointment.ContactPhone}}, {{Appointment.OnlineMeetingUrl}}, {{Appointment.Location}}, {{Appointment.HeldUntil}}, {{Appointment.Source}}, {{Appointment.Status}}, plus the ticket placeholders such as {{EndUser.Firstname}}. A line whose only placeholder is an empty meeting link or location is left out.

What is sent

  • On confirm: a confirmation and, per active reminder offset, a reminder (only when it is still in the future). After a move or reassign: a change notice, and the reminders are planned again. On cancel: a cancellation notice; what was not sent yet is withdrawn. Holds that are released or expire send nothing.
  • The channel is chosen at send time: e-mail when the end user has an address and the account an active e-mail channel; otherwise WhatsApp in the ticket’s own conversation (when the type allows it and the conversation window is open); otherwise SMS through the account’s SMS channel. When none is possible, the notification is Blocked, the reason is added to the appointment’s warning and a note is placed on the ticket. An appointment without a ticket sends nothing.
  • The language is the end user’s language, else the forced reply language of the ticket’s channel, else Dutch; then the text in that language, else English.

Notification (response)

appointmentNotificationID, appointmentID, kind, channel (null when blocked), recipient (address or number), language, reminderOffsetMinutes, dueUtc, scheduleVersion, status (Scheduled, Claimed, Sent, SendUncertain, Failed, Blocked or Withdrawn), attemptCount, sentUtc, lastError and ticketMessageID.

PUT /api/AppointmentTypes/14/notification-templates
Authorization: Bearer <token>
Content-Type: application/json

{
  "templates": [
    {
      "kind": "Confirmation", "channel": "Email", "language": "en",
      "subject": "Your appointment on {{Appointment.Date}} is confirmed",
      "body": "Dear {{EndUser.Firstname}},\n\nSee you on {{Appointment.Date}} at {{Appointment.Time}} ({{Appointment.TimeZone}}).\nAddress: {{Appointment.Location}}\n\nKind regards",
      "isActive": true
    },
    {
      "kind": "Reminder", "channel": "Sms", "language": "en", "reminderOffsetMinutes": 1440,
      "body": "Reminder: {{Appointment.TypeName}} on {{Appointment.Date}} at {{Appointment.Time}}.",
      "isActive": true
    }
  ]
}

200 OK
[
  { "appointmentNotificationTemplateID": 7701, "kind": "Confirmation", "channel": "Email", "language": "en", "reminderOffsetMinutes": null, "subject": "...", "body": "...", "isActive": true, "updatedUtc": "2026-12-01T10:30:00Z" },
  { "appointmentNotificationTemplateID": 7702, "kind": "Reminder", "channel": "Sms", "language": "en", "reminderOffsetMinutes": 1440, "subject": null, "body": "...", "isActive": true, "updatedUtc": "2026-12-01T10:30:00Z" }
]
GET /api/Appointments/5120/notifications
Authorization: Bearer <token>

200 OK
[
  { "appointmentNotificationID": 4410, "appointmentID": 5120, "kind": "Confirmation", "channel": "Email", "recipient": "lena.janssens@example.com", "language": "nl", "reminderOffsetMinutes": null, "dueUtc": "2026-12-01T10:15:02Z", "scheduleVersion": 1, "status": "Sent", "attemptCount": 1, "sentUtc": "2026-12-01T10:15:40Z", "lastError": null, "ticketMessageID": 991203 },
  { "appointmentNotificationID": 4411, "appointmentID": 5120, "kind": "Reminder", "channel": "Email", "recipient": "lena.janssens@example.com", "language": "nl", "reminderOffsetMinutes": 1440, "dueUtc": "2026-12-07T09:00:00Z", "scheduleVersion": 1, "status": "Scheduled", "attemptCount": 0, "sentUtc": null, "lastError": null, "ticketMessageID": null }
]

Bookable hours and calendar

Bookable hours

  • general
    Blocks { "dayOfWeek": 1, "startTime": "09:00", "endTime": "12:00" }: dayOfWeek 0 (Sunday) to 6 (Saturday), times HH:mm in the representative’s time zone, start before end. Blocks on one day may touch but not overlap.
  • types
    Per appointment type in the representative’s pool: appointmentTypeID, useOwnHours and hours (blocks; only with useOwnHours). Own hours replace the general hours for that type, also when empty (then the type cannot be booked at this representative). The response adds name, kind, isActive and effectiveHours (the hours that apply).
  • A PUT replaces everything; a type you leave out uses the general hours. The response holds customerRepID, timeZone, general and types.

Outlook working hours

Reads the working hours from the representative’s Outlook and converts them to the representative’s time zone, as a proposal: mailbox, outlookTimeZone, repTimeZone, converted, proposal (blocks) and warnings. Check the proposal before saving it with PUT .../bookable-hours: Outlook’s per-day work hours and locations are not part of it. Without a linked calendar: 400. When Outlook cannot be read: 502.

Agenda

For one representative and period (at most 31 days): bookableBlocks (the type’s hours with appointmentTypeId, else the general hours), outlookWorkingHours, busy (busy times only, no details), appointments (with type, end user, status, buffers and address), plus calendarEnabled, notInPool, calendarError, outlookWorkingHoursError and warnings. Every interval has startUtc, endUtc, startLocal and endLocal.

Calendar status

customerRepID, calendarEnabled, mailbox, calendarLastError, calendarLastErrorAt, subscriptionActive, subscriptionExpiresUtc, subscriptionError, subscriptionErrorAt, lastReconciledUtc (the last daily comparison with Outlook), upcomingAppointments, upcomingAppointmentsInOtherMailbox and otherMailboxes. The calendar link itself is set on the representative (calendarEnabled and calendarMailbox, see the Representatives endpoints); it needs a Microsoft 365 e-mail setup of the account.

PUT /api/CustomerReps/7/bookable-hours
Authorization: Bearer <token>
Content-Type: application/json

{
  "general": [
    { "dayOfWeek": 1, "startTime": "09:00", "endTime": "12:00" },
    { "dayOfWeek": 1, "startTime": "13:00", "endTime": "17:00" },
    { "dayOfWeek": 3, "startTime": "09:00", "endTime": "12:30" }
  ],
  "types": [
    { "appointmentTypeID": 14, "useOwnHours": true, "hours": [ { "dayOfWeek": 2, "startTime": "08:30", "endTime": "16:00" } ] }
  ]
}

200 OK
{
  "customerRepID": 7,
  "timeZone": "Romance Standard Time",
  "general": [ ... ],
  "types": [
    { "appointmentTypeID": 12, "name": "Intake call", "kind": "Phone", "isActive": true, "useOwnHours": false, "hours": [], "effectiveHours": [ ...general... ] },
    { "appointmentTypeID": 14, "name": "Home visit", "kind": "OnSite", "isActive": true, "useOwnHours": true, "hours": [ { "dayOfWeek": 2, "startTime": "08:30", "endTime": "16:00" } ], "effectiveHours": [ { "dayOfWeek": 2, "startTime": "08:30", "endTime": "16:00" } ] }
  ]
}
GET /api/CustomerReps/7/agenda?from=2026-12-07T00:00:00Z&to=2026-12-14T00:00:00Z
Authorization: Bearer <token>

200 OK
{
  "customerRepID": 7,
  "name": "Sam Peeters",
  "timeZone": "Romance Standard Time",
  "calendarEnabled": true,
  "fromUtc": "2026-12-07T00:00:00Z",
  "toUtc": "2026-12-14T00:00:00Z",
  "appointmentTypeID": null,
  "notInPool": false,
  "bookableBlocks": [ { "startUtc": "2026-12-07T08:00:00Z", "endUtc": "2026-12-07T11:00:00Z", "startLocal": "2026-12-07T09:00:00", "endLocal": "2026-12-07T12:00:00" } ],
  "outlookWorkingHours": [ ... ],
  "busy": [ { "startUtc": "2026-12-07T12:00:00Z", "endUtc": "2026-12-07T13:00:00Z", "startLocal": "2026-12-07T13:00:00", "endLocal": "2026-12-07T14:00:00" } ],
  "appointments": [ { "appointmentID": 5120, "ticketID": 48213, "appointmentTypeName": "Intake call", "endUserName": "Lena Janssens", "status": "Confirmed", "startUtc": "2026-12-08T09:00:00Z", "endUtc": "2026-12-08T09:30:00Z", ... } ],
  "calendarError": null,
  "outlookWorkingHoursError": null,
  "warnings": []
}
GET /api/CustomerReps/7/calendar-status
Authorization: Bearer <token>

200 OK
{
  "customerRepID": 7,
  "calendarEnabled": true,
  "mailbox": "sam.peeters@example.com",
  "calendarLastError": null,
  "calendarLastErrorAt": null,
  "subscriptionExpiresUtc": "2026-12-04T08:00:00Z",
  "subscriptionActive": true,
  "subscriptionError": null,
  "subscriptionErrorAt": null,
  "lastReconciledUtc": "2026-12-01T03:12:44Z",
  "upcomingAppointments": 4,
  "upcomingAppointmentsInOtherMailbox": 0,
  "otherMailboxes": []
}

Ticket contacts and meeting invitations

Appointment contacts of a ticket

The ticket’s sender (address or number) is compared with the identifiers of the account’s end users. The answer holds ticketID, identity, identityType (Email, Phone or Channel), identityUsable (false for a withheld number or a chat visitor), channelType, resolution (None, Single or Multiple), selectedEndUserID (only for Single), candidates (endUserID, name, company, email, phone, address) and openRequestCount.

Meeting invitation

  • Fields
    messageID, ticketID, meetingMessageType (Request or Cancelled), startUtc, endUtc, previousStartUtc, previousEndUtc, isAllDay, isRecurring, eventScope, recurrence, location, onlineMeetingUrl, organizerName, organizerAddress, mailboxAddress (the channel mailbox that answers), responseRequested.
  • Answer state
    response (Accepted, TentativelyAccepted or Declined, when answered from AnswerPal), responseComment, respondedUtc, respondedByName, calendarResponse (the answer in the calendar, also when given in Outlook), isCancelled, isOutOfDate, canRespond, cannotRespondReason (NotOffice365, CalendarAccessDenied, Cancelled, OutOfDate or EventNotFound), liveState (Live or Stored), conflicts (up to 5 overlapping items in the mailbox’s calendar), newerMessageID, newerTicketID, newerMessageInaccessible, isOnlyIncomingMessage.
  • Respond (body)
    response (required): accept, tentative or decline; comment (optional, max 2,000). The answer is given in the channel mailbox’s calendar, as in Outlook. A reply mail goes to the organizer only when the organizer asked for responses; otherwise the comment is not sent. Answering needs a Microsoft 365 e-mail channel.
  • Errors
    400 { "code": "InvalidResponse" | "CommentTooLong", "message": "..." }; 409 with code set to one of the reasons above or Busy (another answer is being sent), plus the current meeting; 502 GraphError or GraphTimeout when Microsoft 365 refused or did not answer in time.
GET /api/Tickets/48213/appointment-contacts
Authorization: Bearer <token>

200 OK
{
  "ticketID": 48213,
  "identity": "+32470000000",
  "identityType": "Phone",
  "identityUsable": true,
  "channelType": "Phone",
  "resolution": "Single",
  "selectedEndUserID": 9051,
  "candidates": [
    { "endUserID": 9051, "name": "Lena Janssens", "company": "Example BV", "email": "lena.janssens@example.com", "phone": "+32470000000", "address": "Markt 1, 8000 Brugge" }
  ],
  "openRequestCount": 0
}
GET /api/ticketmessages/991500/meeting
Authorization: Bearer <token>

200 OK
{
  "messageID": 991500,
  "ticketID": 48250,
  "meetingMessageType": "Request",
  "startUtc": "2026-12-03T13:00:00Z",
  "endUtc": "2026-12-03T14:00:00Z",
  "isAllDay": false,
  "isRecurring": false,
  "eventScope": "singleInstance",
  "location": "Microsoft Teams Meeting",
  "onlineMeetingUrl": "https://teams.example.com/l/meetup-join/abc",
  "organizerName": "Jan De Smet",
  "organizerAddress": "jan.desmet@example.com",
  "mailboxAddress": "support@example.com",
  "responseRequested": true,
  "response": null,
  "calendarResponse": null,
  "canRespond": true,
  "cannotRespondReason": null,
  "liveState": "Live",
  "conflicts": [ { "subject": null, "startUtc": "2026-12-03T13:30:00Z", "endUtc": "2026-12-03T14:30:00Z", "isAllDay": false, "showAs": "busy" } ],
  ...
}
POST /api/ticketmessages/991500/meeting/respond
Authorization: Bearer <token>
Content-Type: application/json

{
  "response": "accept",
  "comment": "See you then."
}

200 OK
{
  "messageID": 991500,
  "response": "Accepted",
  "responseComment": "See you then.",
  "respondedUtc": "2026-12-01T10:40:12Z",
  "respondedByName": "Sam Peeters",
  "calendarResponse": "Accepted",
  ...
}

Access and status codes

Every endpoint needs a bearer token. Appointments, requests, notifications, ticket contacts and meeting invitations follow the ticket: a RestrictedUser reaches the tickets assigned to them, an Agent also unassigned tickets, a Supervisor, Configurator or Administrator every ticket of the account; Analyst has no access. An appointment without a ticket counts as assigned to its representative. Appointment types and notification texts are for an Administrator. The access line of each endpoint above is the reference; the in-text notes on bookable hours, agenda and needs-reassignment add the checks made per representative.

  • 200 OK, 201 Created, 204 No Content
    Success. A change can return an in-between status (Confirming, Rescheduling, Reassigning, Cancelling) while the calendar is updated.
  • 400 Bad Request
    Invalid input, usually { "error": "..." } (notification texts use { "message": "..." }, meeting answers { "code", "message" }): a missing required value, a time that cannot be booked or lies in the past, a representative outside the pool, an incomplete address, overlapping hours.
  • 401 Unauthorized, 403 Forbidden
    No valid token, a role or ticket you may not use, or another representative’s hours or agenda.
  • 404 Not Found
    No appointment, request, type, ticket, message or representative with that ID for this account. The body is empty, a short text or { "error": "..." }.
  • 409 Conflict
    The time is no longer free, the status does not allow the change, another change is running, the representative is being booked by another request (try again), or the type is in use.
  • 502 Bad Gateway
    Microsoft 365 could not be reached for Outlook working hours or a meeting answer.

FAQ

Look at unavailableReason and calendarError in the availability answer: the representative may be outside the pool, have no bookable hours for the type, have a calendar that cannot be read, or the period may fall outside the type's lead time and horizon.

No. The end user gets the notification texts (confirmation, reminders, changes, cancellation) by e-mail, WhatsApp or SMS. Only the representative's calendar gets an event; for online types it holds the Teams meeting whose link is in onlineMeetingUrl and in {{Appointment.OnlineMeetingUrl}}.

It expires after 5 minutes (or the type's propose-only time) and becomes Cancelled with reason Hold expired. Nobody is informed and a linked request is open again.

Need more help?

Table of Contents

AnswerPal: AI-powered customer service solutions to elevate your support and communication effortlessly.

Contact

For all support, sales, and partnership inquiries, email us at info@answerpal.eu

AnswerPal
Bisschoppenhoflaan 380
2100 Antwerp
Belgium

+32.36416685

BE 0862.692.858